From 0b9b69be3828f0b648c7a59bde84933100ac1d70 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 17 Mar 2004 17:25:24 +0000 Subject: [PATCH] - MFH (crash in imagecolortransparent with invalid color index) --- 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 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; -- 2.50.1