From f223262bcd3207986d9bc2f5d5ac43fe10b5e8f1 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 17 Mar 2004 17:07:31 +0000 Subject: [PATCH] - Fix crash when an invalid color index is used with 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 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; -- 2.50.1