emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ac83b2d: Fix handling of XBM images on MS-Windows


From: Eli Zaretskii
Subject: [Emacs-diffs] master ac83b2d: Fix handling of XBM images on MS-Windows
Date: Sat, 11 Feb 2017 04:56:12 -0500 (EST)

branch: master
commit ac83b2dfe4504babfbafc5efb37dbde4bed34fed
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 src/image.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/image.c b/src/image.c
index a7a9416..1e8ebfd 100644
--- a/src/image.c
+++ b/src/image.c
@@ -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]);
           }



reply via email to

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