1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 15:52:00 -08:00

(pbm_load): Correctly check image size for greyscale pbm.

This commit is contained in:
Chong Yidong 2007-05-12 23:53:57 +00:00
parent 96587f7eb9
commit d2dc1adfd0

View file

@ -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;