summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-03-18 23:09:57 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-03-18 23:09:57 +0000
commit39e653ead8fb85137f5d5d060ad658150c698486 (patch)
tree18c9b845d1301cabb7c72689d628ffb1f19f37bd /src
parentb55252e06b5bbdde1f8f31d91faef474973cf965 (diff)
downloademacs-39e653ead8fb85137f5d5d060ad658150c698486.tar.gz
(pbm_load): Signal error for invalid image size.
Diffstat (limited to 'src')
-rw-r--r--src/image.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c
index c58e0d4695e..b8317b1e982 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5742,6 +5742,14 @@ pbm_load (f, img)
}
else
{
+ if (raw_p && (p + 3 * height * width > end))
+ {
+ x_destroy_x_image (ximg);
+ image_error ("Invalid image size in image `%s'",
+ img->spec, Qnil);
+ goto error;
+ }
+
for (y = 0; y < height; ++y)
for (x = 0; x < width; ++x)
{