]> granicus.if.org Git - php/commitdiff
Applied imagedeallocate() fix
authorRasmus Lerdorf <rasmus@php.net>
Fri, 22 Nov 2002 23:25:14 +0000 (23:25 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 22 Nov 2002 23:25:14 +0000 (23:25 +0000)
ext/gd/gd.c

index fb616b379e06f9f9221613213d362d76730eb64f..d23574048e323952a7a817121bb60dd4d0a8ae73 100644 (file)
@@ -1867,6 +1867,13 @@ PHP_FUNCTION(imagecolordeallocate)
 
        ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
 
+       #if HAVE_LIBGD20
+       /* We can return right away for a truecolor image as deallocating colours is meaningless here */
+       if (gdImageTrueColor(im)) {
+               RETURN_TRUE;
+       }
+       #endif
+
        convert_to_long_ex(index);
        col = Z_LVAL_PP(index);