bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56553: 29.0.50; ASAN error with fringe bitmaps on NS


From: Andreas Schwab
Subject: bug#56553: 29.0.50; ASAN error with fringe bitmaps on NS
Date: Fri, 15 Jul 2022 16:46:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.90 (gnu/linux)

Does this work?

diff --git a/src/nsterm.m b/src/nsterm.m
index 8e0c4b84f0..30768baced 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2900,10 +2900,7 @@ Hide the window (X11 semantics)
   for (int y = 0 ; y < h ; y++)
     for (int x = 0 ; x < w ; x++)
       {
-        /* XBM rows are always round numbers of bytes, with any unused
-           bits ignored.  */
-        int byte = y * (w/8 + (w%8 ? 1 : 0)) + x/8;
-        bool bit = bits[byte] & (0x80 >> x%8);
+        bool bit = bits[y] & (1 << (w - x - 1));
         if (bit)
           [p appendBezierPathWithRect:NSMakeRect (x, y, 1, 1)];
       }

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]