From 7c72c8dc8b5d24c57ec312ba7da0ae1cc19d99ec Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 15 Mar 2022 19:53:46 +0000 Subject: Bug 705063: Fix blank_unmasked_bits to work msb, not lsb. When working with alphabits, we read pixels back from the destination buffer, process it, and then write it out again. The reading of the current pixels is done via get_bits_rectangle. When working with a mask, this calls blank_unmasked_bits to avoid returning undefined values. This routine was incorrectly written to read the mask as it pixels were packed into a byte least significant bit first. Correct it to work most significant bit first. --- base/gxpcmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/gxpcmap.c b/base/gxpcmap.c index ae79987f0..86af08854 100644 --- a/base/gxpcmap.c +++ b/base/gxpcmap.c @@ -676,7 +676,7 @@ blank_unmasked_bits(gx_device * mask, for (x = 0; x < w; x++) { int xx = x+x0; - if (((mine[xx>>3]>>(x&7)) & 1) == 0) { + if (((mine[xx>>3]<<(x&7)) & 128) == 0) { switch (depth) { case 8: -- cgit v1.2.1