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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php