Fix handling of XBM images on MS-Windows
* src/image.c (xbm_load) [HAVE_NTGUI]: Fix calculation of 'nbytes' when inverting XBM data bits. (Bug#25661)
This commit is contained in:
@@ -3110,8 +3110,8 @@ xbm_load (struct frame *f, struct image *img)
|
||||
int nbytes, i;
|
||||
/* Windows mono bitmaps are reversed compared with X. */
|
||||
invertedBits = bits;
|
||||
nbytes = (img->width + CHAR_BIT - 1) / CHAR_BIT;
|
||||
SAFE_NALLOCA (bits, nbytes, img->height);
|
||||
nbytes = (img->width + CHAR_BIT - 1) / CHAR_BIT * img->height;
|
||||
SAFE_NALLOCA (bits, 1, nbytes);
|
||||
for (i = 0; i < nbytes; i++)
|
||||
bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user