From: Chong Yidong Date: Mon, 14 May 2007 14:53:15 +0000 (+0000) Subject: (pbm_load): Check image size for monochrome pbm. X-Git-Tag: emacs-pretest-23.0.90~12678 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c295e710a2de066fd57c10bf800a90980b1b5704;p=emacs.git (pbm_load): Check image size for monochrome pbm. --- 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; }