This commit is contained in:
Rasmus Lerdorf 2002-10-16 22:34:44 +00:00
parent 8361687a4a
commit ebfd9aaa47

View file

@ -1493,7 +1493,7 @@ gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
my_cquantize_ptr cquantize = 0; my_cquantize_ptr cquantize = 0;
int i; int i;
size_t arraysize; size_t arraysize;
if (!im->trueColor) if (!im->trueColor || colorsWanted <= 0)
{ {
/* Nothing to do! */ /* Nothing to do! */
return; return;