summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-02-25 18:19:07 +0000
committerChris Liddell <chris.liddell@artifex.com>2020-02-26 08:18:49 +0000
commit635303ca7d8a36b3dabc9afbd9132f4b9a36dce5 (patch)
treedcd8dd3febb4b1c95daf3885de046b0609457da7
parenta00c75369e082798d82202a2b64d8e4b484d0c11 (diff)
downloadghostpdl-635303ca7d8a36b3dabc9afbd9132f4b9a36dce5.tar.gz
Fix psdcmyk16 blending issue.
Use uint32_t rather than int to avoid signedness issues. Seen in the psdcmyk16 page mode rendering of tests_private/comparefiles/Bug692766.pdf (bad colors in 4th rgb circle intersection test).
-rw-r--r--base/gxblend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/gxblend.c b/base/gxblend.c
index 334f9717d..aa57f5904 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -2188,7 +2188,7 @@ art_pdf_recomposite_group_16(uint16_t *gs_restrict *dstp, uint16_t *gs_restrict
{
uint16_t dst_alpha;
int i;
- int tmp;
+ uint32_t tmp;
int scale;
uint16_t *gs_restrict dst = *dstp;
@@ -2241,7 +2241,7 @@ art_pdf_recomposite_group_16(uint16_t *gs_restrict *dstp, uint16_t *gs_restrict
tmp = (src_alpha_g * tmp + 0x8000)>>16;
src[n_chan] = tmp;
if (dst_alpha_g != NULL) {
- int d = *dst_alpha_g;
+ uint32_t d = *dst_alpha_g;
d += d>>15;
tmp = (0x10000 - d) * (0xffff - tmp) + 0x8000;
*dst_alpha_g = 0xffff - (tmp >> 16);