aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2007-05-14 14:53:15 +0000
committerChong Yidong2007-05-14 14:53:15 +0000
commitc295e710a2de066fd57c10bf800a90980b1b5704 (patch)
treee3db377d35ea061cb81037ee76f1253b12f2bb08 /src
parentc38ffbcb4e6b597d20e2659cf1c00dd2c8b248b4 (diff)
downloademacs-c295e710a2de066fd57c10bf800a90980b1b5704.tar.gz
emacs-c295e710a2de066fd57c10bf800a90980b1b5704.zip
(pbm_load): Check image size for monochrome pbm.
Diffstat (limited to 'src')
-rw-r--r--src/image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index eacea4a1d97..12b27fe359f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5730,7 +5730,17 @@ pbm_load (f, img)
5730 if (raw_p) 5730 if (raw_p)
5731 { 5731 {
5732 if ((x & 7) == 0) 5732 if ((x & 7) == 0)
5733 c = *p++; 5733 {
5734 if (p >= end)
5735 {
5736 x_destroy_x_image (ximg);
5737 x_clear_image (f, img);
5738 image_error ("Invalid image size in image `%s'",
5739 img->spec, Qnil);
5740 goto error;
5741 }
5742 c = *p++;
5743 }
5734 g = c & 0x80; 5744 g = c & 0x80;
5735 c <<= 1; 5745 c <<= 1;
5736 } 5746 }