Fix ASAN error with fringe bitmap on NS

* src/nsterm.m (ns_define_fringe_bitmap): Correctly access fringe
bitmap data.  (Bug#56553)
This commit is contained in:
Andreas Schwab 2022-07-15 17:24:19 +02:00
parent bd35ced042
commit 889943e2bd

View file

@ -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)];
}