From ebfd9aaa47edcbee45f5853b25f7ccd012c78113 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Wed, 16 Oct 2002 22:34:44 +0000 Subject: [PATCH] Fix for bug #19941 --- ext/gd/libgd/gd_topal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/gd/libgd/gd_topal.c b/ext/gd/libgd/gd_topal.c index 392e93419ef..7e2de25fc5d 100644 --- a/ext/gd/libgd/gd_topal.c +++ b/ext/gd/libgd/gd_topal.c @@ -1493,7 +1493,7 @@ gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted) my_cquantize_ptr cquantize = 0; int i; size_t arraysize; - if (!im->trueColor) + if (!im->trueColor || colorsWanted <= 0) { /* Nothing to do! */ return;