(pbm_load): Check image size for monochrome pbm.

This commit is contained in:
Chong Yidong 2007-05-14 14:53:15 +00:00
parent c38ffbcb4e
commit c295e710a2

View file

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