cvs: php-src(PHP_5_1) /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37346.gif bug37346.phpt
| From: | Pierre-Alain Joye | Date: | Sun, 07 May 2006 17:14:36 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37346.gif bug37346.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38057@lists.php.net to get a copy of this message | ||
pajoye Sun May 7 17:14:36 2006 UTC
Added files: (Branch: PHP_5_1)
/php-src/ext/gd/tests bug37346.phpt bug37346.gif
Modified files:
/php-src/ext/gd/libgd gd_gif_in.c
Log:
- MF52, #37346, invalid colormap format
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2&r2=1.5.4.3&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2 php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.3
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2 Sat Sep 24 14:39:16 2005
+++ php-src/ext/gd/libgd/gd_gif_in.c Sun May 7 17:14:36 2006
@@ -44,7 +44,7 @@
#define LOCALCOLORMAP 0x80
#define BitSet(byte, bit) (((byte) & (bit)) == (bit))
-#define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) != 0)
+#define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) > 0)
#define LM_to_uint(a,b) (((b)<<8)|(a))
@@ -184,14 +184,18 @@
imw = LM_to_uint(buf[4],buf[5]);
imh = LM_to_uint(buf[6],buf[7]);
- if (!(im = gdImageCreate(imw, imh))) {
- return 0;
- }
- im->interlace = BitSet(buf[8], INTERLACE);
+
if (! useGlobalColormap) {
if (ReadColorMap(fd, bitPixel, localColorMap)) {
return 0;
}
+ }
+
+ if (!(im = gdImageCreate(imw, imh))) {
+ return 0;
+ }
+ im->interlace = BitSet(buf[8], INTERLACE);
+ if (! useGlobalColormap) {
ReadImage(im, fd, imw, imh, localColorMap,
BitSet(buf[8], INTERLACE));
/*1.4//imageCount != imageNumber); */
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37346.phpt?view=markup&rev=1.1
Index: php-src/ext/gd/tests/bug37346.phpt
+++ php-src/ext/gd/tests/bug37346.phpt