From e5f4d5841eb5a980c2ccc0d6d021dd67e1147284 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Thu, 3 Sep 2009 09:45:56 +0000 Subject: [PATCH] - Fix sanity check for the color index in imagecolortransparent --- ext/gd/libgd/gd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.40.0