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.4.0alpha1~191^2~2704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5f4d5841eb5a980c2ccc0d6d021dd67e1147284;p=php - Fix sanity check for the color index in imagecolortransparent --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 05def991b6..d76cf3fb93 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -595,7 +595,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;