cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37346.gif bug37346.phpt

From: Date: Sun, 07 May 2006 16:37:40 +0000
Subject: cvs: php-src(PHP_5_2) /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-38055@lists.php.net to get a copy of this message
pajoye Sun May 7 16:37:40 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/gd/tests bug37346.phpt bug37346.gif Modified files: /php-src/ext/gd/libgd gd_gif_in.c Log: - #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.2.2.1&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.2.2.1 --- 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 16:37:40 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,19 @@ imw = LM_to_uint(buf[4],buf[5]); imh = LM_to_uint(buf[6],buf[7]); - if (!(im = gdImageCreate(imw, imh))) { - return 0; - } + + if (!useGlobalColormap) { + if (ReadColorMap(fd, bitPixel, localColorMap)) { + return 0; + } + } + + if (!(im = gdImageCreate(imw, imh))) { + return 0; + } + im->interlace = BitSet(buf[8], INTERLACE); if (! useGlobalColormap) { - if (ReadColorMap(fd, bitPixel, localColorMap)) { - return 0; - } 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

« previous php.cvs (#38055) next »