summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2017-06-28 16:57:20 -0700
committerRobin Watts <robin.watts@artifex.com>2017-07-17 19:32:06 +0100
commit8260c7b828c5df4895db15196be70b4bb58fbee7 (patch)
treeb708704e53f93a79497a29528087eea146e40b43
parent731832ba5518018875e8674e0c48ab1bb92d86bc (diff)
downloadmupdf-8260c7b828c5df4895db15196be70b4bb58fbee7.tar.xz
Fix issues in alpha removal during color management
During code refactor a few bugs were introduced.
-rw-r--r--source/fitz/color-lcms.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/fitz/color-lcms.c b/source/fitz/color-lcms.c
index 4e75850f..8563f9bf 100644
--- a/source/fitz/color-lcms.c
+++ b/source/fitz/color-lcms.c
@@ -98,6 +98,7 @@ fz_lcms_unmultiply_row(fz_context *ctx, int n, int w, unsigned char *s, const un
inva = a ? 255 * 256 / a : 0;
for (k = 0; k < n1; k++)
s[k] = (in[k] * inva) >> 8;
+ s[n1] = a;
s += n;
in += n;
}
@@ -139,7 +140,7 @@ fz_lcms_transform_pixmap(fz_cmm_instance *instance, fz_icclink *link, fz_pixmap
for (; h > 0; h--)
{
fz_lcms_unmultiply_row(ctx, sn, sw, buffer, inputpos);
- cmsDoTransform(cmm_ctx, hTransform, inputpos, outputpos, sw);
+ cmsDoTransform(cmm_ctx, hTransform, buffer, outputpos, sw);
fz_lcms_premultiply_row(ctx, dn, dw, outputpos);
inputpos += ss;
outputpos += ds;