Mercurial > emacs
comparison src/image.c @ 80916:4e046b2396ef
(pbm_load): Check image size for monochrome pbm.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 14 May 2007 14:53:15 +0000 |
parents | f6cc3f58ce04 |
children | e2ef7cb33308 0a3247aa24a4 d7172f202ab8 |
comparison
equal
deleted
inserted
replaced
80915:99c147d98917 | 80916:4e046b2396ef |
---|---|
5728 for (x = 0; x < width; ++x) | 5728 for (x = 0; x < width; ++x) |
5729 { | 5729 { |
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 } |
5737 else | 5747 else |
5738 g = pbm_scan_number (&p, end); | 5748 g = pbm_scan_number (&p, end); |