From: Rasmus Lerdorf Date: Fri, 22 Nov 2002 23:25:14 +0000 (+0000) Subject: Applied imagedeallocate() fix X-Git-Tag: RELEASE_1_0b2~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=761bcbd751b930abb4ab6bac55089182cce82051;p=php Applied imagedeallocate() fix --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index fb616b379e..d23574048e 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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);