[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1630-gcfdb64e
[email protected] (Robin Watts)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via cfdb64eec150da48dea5063b14ae7596e6b7050a (commit)
from eeeb033d21f22b128900ebc998668c87be725f7d (commit)
----------------------------------------------------------------------
commit cfdb64eec150da48dea5063b14ae7596e6b7050a
Author: Robin Watts <[email protected]>
Date: Mon Sep 2 17:16:45 2019 +0100
Proper fix for deep color overprint.
The previous fix confused memset and memcpy. Properly write the
(native endian) 16 bit color values into the big endian buffer.
diff --git a/base/gsovrc.c b/base/gsovrc.c
index ad75b58..d29808d 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -1055,6 +1055,16 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
x, y, w, h, plane_height);
}
}
+static void
+my_memset16_be(uint16_t *dst, uint16_t col, size_t w)
+{
+#if !ARCH_IS_BIG_ENDIAN
+ col = (col>>8) | (col<<8);
+#endif
+ while (w--) {
+ *dst++ = col;
+ }
+}
/* Currently we really should only be here if the target device is planar
AND it supports devn colors AND is 8 or 16 bit. */
@@ -1143,8 +1153,12 @@ overprint_fill_rectangle_hl_color(gx_device *dev,
operation we would just get the ones needed and set those. */
if ((comps & 0x01) == 1) {
/* Not sure if a loop or a memset is better here */
- memset(gb_params.data[k],
- ((pdcolor->colors.devn.values[k]) >> shift & mask), w<<deep);
+ if (deep)
+ my_memset16_be((uint16_t *)(gb_params.data[k]),
+ pdcolor->colors.devn.values[k], w);
+ else
+ memset(gb_params.data[k],
+ ((pdcolor->colors.devn.values[k]) >> shift & mask), w);
}
comps >>= 1;
}
Summary of changes:
base/gsovrc.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)