From 79868f856603d3cf4e8f0aff7c5e1303c8f1ecd7 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 6b1de0909e..9b942862cf 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2009, PHP 5.2.11 - Added missing sanity checks around exif processing (Ilia) +- Fixed sanity check for the color index in imagecolortransparent. (Pierre) - Fixed zlib.deflate compress filter to actually accept level parameter. (Jani) - Fixed leak on error in popen/exec (and related functions on Windows. (Pierre) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index eb3668e215..c375cea876 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -591,7 +591,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