From 8f8220917e30ddd0c5fa0956581f0b4f00d90d9f 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 --- NEWS | 1 + ext/gd/libgd/gd.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0b6f351fac..cc7c9c1abd 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ PHP NEWS - Improved shared extension loading on OSX to use the standard Unix dlopen() API. (Scott) +- Fixed sanity check for the color index in imagecolortransparent. (Pierre) - Fixed scandir/readdir when used mounted points on Windows. (Pierre) - Fixed zlib.deflate compress filter to actually accept level parameter. (Jani) - Fixed leak on error in popen/exec (and related functions) on Windows. diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 5b4f923596..a0ea6f198a 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.49.0