cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37360.gif bug37360.phpt
| From: | Pierre-Alain Joye | Date: | Mon, 08 May 2006 11:50:47 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37360.gif bug37360.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38071@lists.php.net to get a copy of this message | ||
pajoye Mon May 8 11:50:47 2006 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/gd/tests bug37360.gif bug37360.phpt
Modified files:
/php-src/ext/gd/libgd gd_gif_in.c
Log:
- MFH: #37360, bad gif size
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.2&r2=1.5.4.2.2.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.2.2 php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.3
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.2 Mon May 8 11:12:49 2006
+++ php-src/ext/gd/libgd/gd_gif_in.c Mon May 8 11:50:47 2006
@@ -147,6 +147,9 @@
Background = buf[5];
AspectRatio = buf[6];
+ imw = LM_to_uint(buf[0],buf[1]);
+ imh = LM_to_uint(buf[2],buf[3]);
+
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
if (ReadColorMap(fd, BitPixel, ColorMap)) {
return 0;
@@ -182,9 +185,6 @@
bitPixel = 1<<((buf[8]&0x07)+1);
- imw = LM_to_uint(buf[4],buf[5]);
- imh = LM_to_uint(buf[6],buf[7]);
-
if (!useGlobalColormap) {
if (ReadColorMap(fd, bitPixel, localColorMap)) {
return 0;
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37360.phpt?view=markup&rev=1.1
Index: php-src/ext/gd/tests/bug37360.phpt
+++ php-src/ext/gd/tests/bug37360.phpt
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php
$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
var_dump($im);
?>
--EXPECTF--
resource(%d) of type (gd)