(pbm_load): Correctly check image size for greyscale pbm.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user