emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 44578d9: Fix handling of PBM data


From: Eli Zaretskii
Subject: [Emacs-diffs] master 44578d9: Fix handling of PBM data
Date: Sat, 11 Feb 2017 04:10:18 -0500 (EST)

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

    Fix handling of PBM data
    
    * src/image.c (pbm_load): Handle PBM data with no blanks between
    individual pixel values correctly.  (Bug#25660)
---
 src/image.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/image.c b/src/image.c
index ad0143b..a7a9416 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5465,7 +5465,17 @@ pbm_load (struct frame *f, struct image *img)
                c <<= 1;
              }
            else
-             g = pbm_scan_number (&p, end);
+             {
+               int c = 0;
+               /* Skip white-space and comments.  */
+               while ((c = pbm_next_char (&p, end)) != -1 && c_isspace (c))
+                 ;
+
+               if (c == '0' || c == '1')
+                 g = c - '0';
+               else
+                 g = 0;
+             }
 
 #ifdef USE_CAIRO
             *dataptr++ = g ? fga32 : bga32;



reply via email to

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