From: Chong Yidong Date: Sat, 12 May 2007 23:55:51 +0000 (+0000) Subject: (pbm_load): Correctly check image size for greyscale pbm. X-Git-Tag: emacs-pretest-23.0.90~12686 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb0b0862c648515df5c81ea973cb8a118f85e6ed;p=emacs.git (pbm_load): Correctly check image size for greyscale pbm. --- diff --git a/src/image.c b/src/image.c index b8317b1e982..eacea4a1d97 100644 --- a/src/image.c +++ b/src/image.c @@ -5742,9 +5742,13 @@ pbm_load (f, img) } else { - if (raw_p && (p + 3 * height * width > end)) + if (raw_p + && ((type == PBM_GRAY) + ? (p + height * width > end) + : (p + 3 * height * width > end))) { x_destroy_x_image (ximg); + x_clear_image (f, img); image_error ("Invalid image size in image `%s'", img->spec, Qnil); goto error;