summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-02-26 15:22:04 +0000
committerChris Liddell <chris.liddell@artifex.com>2020-02-27 15:31:11 +0000
commitdbaddcf6e251229a1506f2df33844365df39de44 (patch)
treeec1fe70ecdb28ce058a9153662f0edadc42f6493
parent4ad8020c3cb63345dd76119e8978c3353940a68e (diff)
downloadghostpdl-dbaddcf6e251229a1506f2df33844365df39de44.tar.gz
Fix signed issue in 16bit alpha blending fill_rectangle routines.ghostpdl-9.51rc2_test2
As seen by the central spot in the pink region of page 1 of: gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf
-rw-r--r--base/gxblend.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/gxblend.c b/base/gxblend.c
index 859a006c0..4f0d3a0c5 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -5402,7 +5402,7 @@ mark_fill_rect16_sub4_fast(int w, int h, uint16_t *gs_restrict dst_ptr, uint16_t
dst_ptr[4 * planestride] = a_s;
} else if (a_s != 0) {
/* Result alpha is Union of backdrop and source alpha */
- int tmp, src_scale;
+ unsigned int tmp, src_scale;
unsigned int a_r;
a_b += a_b>>15;
@@ -5485,9 +5485,8 @@ mark_fill_rect16_add3_common(int w, int h, uint16_t *gs_restrict dst_ptr, uint16
/* alpha */
dst_ptr[3 * planestride] = a_s;
} else if (a_s != 0) {
- int tmp;
+ unsigned int tmp, src_scale;
unsigned int a_r;
- int src_scale;
a_b += a_b >> 15;
/* Result alpha is Union of backdrop and source alpha */
@@ -5588,8 +5587,9 @@ mark_fill_rect16_add1_no_spots_normal(int w, int h, uint16_t *gs_restrict dst_pt
dst_ptr[planestride] = a_s;
} else {
/* Result alpha is Union of backdrop and source alpha */
- int tmp, src_scale, c_s, c_b;
+ unsigned int tmp, src_scale;
unsigned int a_r;
+ int c_s, c_b;
a_b += a_b>>15;
tmp = (0x10000 - a_b) * (0xffff - a_s) + 0x8000;
@@ -5647,8 +5647,9 @@ mark_fill_rect16_add1_no_spots_fast(int w, int h, uint16_t *gs_restrict dst_ptr,
dst_ptr[planestride] = a_s;
} else if (a_s != 0) {
/* Result alpha is Union of backdrop and source alpha */
- int tmp, src_scale, c_s, c_b;
+ unsigned int tmp, src_scale;
unsigned int a_r;
+ int c_s, c_b;
a_b += a_b>>15;
tmp = (0x10000 - a_b) * (0xffff - a_s) + 0x8000;