http://svn.php.net/viewvc?view=revision&revision=289557 --- gd_gd.c 2009-10-20 11:02:00.000000000 +0200 +++ gd_gd.c.oden 2009-10-20 11:05:18.000000000 +0200 @@ -44,6 +44,9 @@ _gdGetColors (gdIOCtx * in, gdImagePtr i { goto fail1; } + if (im->colorsTotal > gdMaxColors) { + goto fail1; + } } /* Int to accommodate truecolor single-color transparency */ if (!gdGetInt (&im->transparent, in))