diff options
author | Chong Yidong <[email protected]> | 2007-05-12 23:53:57 +0000 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2007-05-12 23:53:57 +0000 |
commit | d2dc1adfd017ac815b2aa32cdafebc7c7f594366 (patch) | |
tree | c263a34287eb3534a81a53f527678063722572f1 /src/image.c | |
parent | 96587f7eb9dc1cdc44a02ece91ebbb260d60ba2b (diff) |
(pbm_load): Correctly check image size for greyscale pbm.
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c index b8317b1e98..eacea4a1d9 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; |