summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-05-14 14:53:15 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-05-14 14:53:15 +0000
commitc295e710a2de066fd57c10bf800a90980b1b5704 (patch)
treee3db377d35ea061cb81037ee76f1253b12f2bb08 /src/image.c
parentc38ffbcb4e6b597d20e2659cf1c00dd2c8b248b4 (diff)
downloademacs-c295e710a2de066fd57c10bf800a90980b1b5704.tar.gz
emacs-c295e710a2de066fd57c10bf800a90980b1b5704.tar.bz2
emacs-c295e710a2de066fd57c10bf800a90980b1b5704.zip
(pbm_load): Check image size for monochrome pbm.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index eacea4a1d97..12b27fe359f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5730,7 +5730,17 @@ pbm_load (f, img)
if (raw_p)
{
if ((x & 7) == 0)
- c = *p++;
+ {
+ if (p >= end)
+ {
+ x_destroy_x_image (ximg);
+ x_clear_image (f, img);
+ image_error ("Invalid image size in image `%s'",
+ img->spec, Qnil);
+ goto error;
+ }
+ c = *p++;
+ }
g = c & 0x80;
c <<= 1;
}