]> granicus.if.org Git - php/commitdiff
Fix for bug #19941
authorRasmus Lerdorf <rasmus@php.net>
Wed, 16 Oct 2002 22:34:44 +0000 (22:34 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 16 Oct 2002 22:34:44 +0000 (22:34 +0000)
ext/gd/libgd/gd_topal.c

index 392e93419ef92beb77f891dbc21550d9014dc2b4..7e2de25fc5d33d0b9a7dcc7c19bb1edb7179c835 100644 (file)
@@ -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;