pajoye Fri Jun 8 05:25:52 2007 UTC
Modified files:
/php-src/ext/gd/libgd gd_gif_in.c
Log:
- MFB: #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.16&r2=1.17&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.16
php-src/ext/gd/libgd/gd_gif_in.c:1.17
--- php-src/ext/gd/libgd/gd_gif_in.c:1.16 Wed Apr 4 11:42:54 2007
+++ php-src/ext/gd/libgd/gd_gif_in.c Fri Jun 8 05:25:52 2007
@@ -590,6 +590,10 @@
/*} */
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