summaryrefslogtreecommitdiff
path: root/base/gdevmem.c
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2015-09-28 09:53:55 +0100
committerChris Liddell <chris.liddell@artifex.com>2015-09-29 16:22:01 +0100
commitda2038b2040827f9f29faa43266477f73d83c043 (patch)
tree2329563e01d142c691dc90d95dd7c0e09c9fa860 /base/gdevmem.c
parent53ac1eca93ac13fead4c4ab8ced0faeee1ee517c (diff)
downloadghostpdl-da2038b2040827f9f29faa43266477f73d83c043.tar.gz
Bug 696229: initialize clist color space validity.
The clist uses a stack variable to hold the device color. Valgrind reports that the ccolor_valid entry in the device color can remain unset, so set it to invalid when the initialize the device color to "unset". Also, add a PACIFY_VALGRIND memset so pattern bitmap buffers are fully zeroed on allocation - stops valgrind getting upset about writing and reading back uninitialised (padding) bytes to/from the clist. No cluster differences.
Diffstat (limited to 'base/gdevmem.c')
-rw-r--r--base/gdevmem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/gdevmem.c b/base/gdevmem.c
index 382ac3284..3019451f4 100644
--- a/base/gdevmem.c
+++ b/base/gdevmem.c
@@ -448,6 +448,13 @@ gdev_mem_open_scan_lines(gx_device_memory *mdev, int setup_height)
"mem_open");
if (mdev->base == 0)
return_error(gs_error_VMerror);
+#ifdef PACIFY_VALGRIND
+ /* If we end up writing the bitmap to the clist, we can get valgrind errors
+ * because we write and read the padding at the end of each raster line.
+ * Easiest to set the entire block.
+ */
+ memset(mdev->base, 0x00, size);
+#endif
align = 1<<mdev->log2_align_mod;
mdev->base += (-(int)mdev->base) & (align-1);
mdev->foreign_bits = false;