cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c

From: Date: Thu, 07 Jun 2007 21:07:33 +0000
Subject: cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-44743@lists.php.net to get a copy of this message
pajoye Thu Jun 7 21:07:33 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/gd/libgd gd_gif_in.c Log: - #41630, fix segfault when an invalid color index is present in the image data http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.11&r2=1.5.4.2.2.12&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.11 php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.12 --- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.11 Wed Apr 4 11:40:11 2007 +++ php-src/ext/gd/libgd/gd_gif_in.c Thu Jun 7 21:07:33 2007 @@ -586,7 +586,10 @@ /* return; */ /*} */ - while ((v = LWZReadByte(fd, &sd, FALSE, c, ZeroDataBlockP)) >= 0 ) { + while ((v = LWZReadByte(fd, &sd, FALSE, c, ZeroDataBlockP)) >= 0) { + if (v >= gdMaxColors) { + v = 0; + } /* This how we recognize which colors are actually used. */ if (im->open[v]) { im->open[v] = 0;

« previous php.cvs (#44743) next »