summaryrefslogtreecommitdiff
path: root/base/gdevm2.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2019-01-19 12:45:45 +0000
committerRobin Watts <robin.watts@artifex.com>2019-01-19 13:05:39 +0000
commitf612df16597bbae73707d0dc9a90235b3de26c6e (patch)
treeb4bbe02d4ba6469cbe9177a2cdab4c9449d14f16 /base/gdevm2.c
parentd1a355ecf8adfce6758638aa79bc9f5338fc1e64 (diff)
downloadghostpdl-f612df16597bbae73707d0dc9a90235b3de26c6e.tar.gz
Preemptively fix more potential valgrind problems.
Again, while we know that a+b = a|b when (a&b)==0 (ignoring overflow), valgrind is not that smart, and can hence incorrectly get undefinedness calculations wrong. Fix cases in gdevm2 that look wrong, in the same way as the previous commit fixed gdevm1.
Diffstat (limited to 'base/gdevm2.c')
-rw-r--r--base/gdevm2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/gdevm2.c b/base/gdevm2.c
index 8b34dfd7d..04a0e60de 100644
--- a/base/gdevm2.c
+++ b/base/gdevm2.c
@@ -116,7 +116,7 @@ mem_mapped2_copy_mono(gx_device * dev,
} else { /* Filling a mask. */
for ( ; ; ) {
if (sbyte & bit)
- *pptr = (*pptr & ~mask) + (b1 & mask);
+ *pptr = (*pptr & ~mask) | (b1 & mask);
if (--count <= 0)
break;
if ((bit >>= 1) == 0)
@@ -129,7 +129,7 @@ mem_mapped2_copy_mono(gx_device * dev,
for ( ; ; ) {
if (!(sbyte & bit)) {
if (zero != gx_no_color_index)
- *pptr = (*pptr & ~mask) + (b0 & mask);
+ *pptr = (*pptr & ~mask) | (b0 & mask);
}
if (--count <= 0)
break;