From: Eli Zaretskii Date: Sat, 11 Feb 2017 09:09:33 +0000 (+0200) Subject: Fix handling of PBM data X-Git-Tag: emacs-26.0.90~848^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44578d9acc952963a2c9acbd7696b65b29af2f6e;p=emacs.git Fix handling of PBM data * src/image.c (pbm_load): Handle PBM data with no blanks between individual pixel values correctly. (Bug#25660) --- diff --git a/src/image.c b/src/image.c index ad0143be48b..a7a94165282 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;