From: Andreas Schwab Date: Fri, 15 Jul 2022 15:24:19 +0000 (+0200) Subject: Fix ASAN error with fringe bitmap on NS X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~1886^2~912 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=889943e2bd5668335649b064b10b70a15c17c189;p=emacs.git Fix ASAN error with fringe bitmap on NS * src/nsterm.m (ns_define_fringe_bitmap): Correctly access fringe bitmap data. (Bug#56553) --- diff --git a/src/nsterm.m b/src/nsterm.m index 582bc9f6a2d..57f1f44de26 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2900,10 +2900,7 @@ ns_define_fringe_bitmap (int which, unsigned short *bits, int h, int w) 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)]; }