From: Pierre Joye Date: Thu, 3 Sep 2009 09:45:56 +0000 (+0000) Subject: - Fix sanity check for the color index in imagecolortransparent X-Git-Tag: php-5.2.11RC2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79868f856603d3cf4e8f0aff7c5e1303c8f1ecd7;p=php - Fix sanity check for the color index in imagecolortransparent --- diff --git a/NEWS b/NEWS index 6b1de0909e..9b942862cf 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2009, PHP 5.2.11 - Added missing sanity checks around exif processing (Ilia) +- Fixed sanity check for the color index in imagecolortransparent. (Pierre) - Fixed zlib.deflate compress filter to actually accept level parameter. (Jani) - Fixed leak on error in popen/exec (and related functions on Windows. (Pierre) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index eb3668e215..c375cea876 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -591,7 +591,7 @@ void gdImageColorTransparent (gdImagePtr im, int color) if (im->transparent != -1) { im->alpha[im->transparent] = gdAlphaOpaque; } - if (color > -1 && colorcolorsTotal && color<=gdMaxColors) { + if (color > -1 && color < im->colorsTotal && color < gdMaxColors) { im->alpha[color] = gdAlphaTransparent; } else { return;