From: Pierre Joye Date: Wed, 17 Mar 2004 17:25:24 +0000 (+0000) Subject: - MFH (crash in imagecolortransparent with invalid color index) X-Git-Tag: php-4.3.5RC4~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b9b69be3828f0b648c7a59bde84933100ac1d70;p=php - MFH (crash in imagecolortransparent with invalid color index) --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 87471898f4..96b6a68873 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -571,7 +571,7 @@ void gdImageColorTransparent (gdImagePtr im, int color) if (im->transparent != -1) { im->alpha[im->transparent] = gdAlphaOpaque; } - if (color > -1 && color<=gdMaxColors) { + if (color > -1 && colorcolorsTotal && color<=gdMaxColors) { im->alpha[color] = gdAlphaTransparent; } else { return;