changeset 76550:05fce28aea26

(pbm_load): Signal error for invalid image size.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 18 Mar 2007 23:09:57 +0000
parents 350d67456479
children 7de34f871bcd
files src/image.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/image.c	Sun Mar 18 23:09:49 2007 +0000
+++ b/src/image.c	Sun Mar 18 23:09:57 2007 +0000
@@ -5742,6 +5742,14 @@
     }
   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)
 	  {