aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c6
1 files changed, 5 insertions, 1 deletions
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)
5742 } 5742 }
5743 else 5743 else
5744 { 5744 {
5745 if (raw_p && (p + 3 * height * width > end)) 5745 if (raw_p
5746 && ((type == PBM_GRAY)
5747 ? (p + height * width > end)
5748 : (p + 3 * height * width > end)))
5746 { 5749 {
5747 x_destroy_x_image (ximg); 5750 x_destroy_x_image (ximg);
5751 x_clear_image (f, img);
5748 image_error ("Invalid image size in image `%s'", 5752 image_error ("Invalid image size in image `%s'",
5749 img->spec, Qnil); 5753 img->spec, Qnil);
5750 goto error; 5754 goto error;