summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2019-09-02 17:16:45 +0100
committerRobin Watts <Robin.Watts@artifex.com>2019-09-02 17:19:31 +0100
commit0288b86e20cdbf31b2df8030de242ffbe93fd418 (patch)
tree4986e321ff62f1f1550ea396062a653b23b3e0fc
parent92bc858b03f206a0e08ca956cb3e5d2a825dffe8 (diff)
downloadghostpdl-gs9.28-temp-for-testing.tar.gz
Proper fix for deep color overprint.gs9.28-temp-for-testing
The previous fix confused memset and memcpy. Properly write the (native endian) 16 bit color values into the big endian buffer.
-rw-r--r--base/gsovrc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/base/gsovrc.c b/base/gsovrc.c
index ad75b5809..d29808d15 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;
}