From: Pierre Joye Date: Wed, 17 Mar 2004 17:07:31 +0000 (+0000) Subject: - Fix crash when an invalid color index is used with imagecolortransparent X-Git-Tag: php-5.0.0RC1~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f223262bcd3207986d9bc2f5d5ac43fe10b5e8f1;p=php - Fix crash when an invalid color index is used with imagecolortransparent --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 4ae2488b1c..7800db9d5a 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -569,7 +569,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;