From: Pierre Joye Date: Tue, 17 Jan 2006 15:23:29 +0000 (+0000) Subject: - Returns FALSE on error, it is how it must work X-Git-Tag: php-5.1.3RC1~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=328c294569b35d61d1ab8b6eb81763417f625035;p=php - Returns FALSE on error, it is how it must work --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index d02eed77b0..9aa328c538 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1095,6 +1095,7 @@ PHP_FUNCTION(imagecolorallocatealpha) zval *IM; long red, green, blue, alpha; gdImagePtr im; + int ct = (-1); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { RETURN_FALSE; @@ -1103,6 +1104,12 @@ PHP_FUNCTION(imagecolorallocatealpha) ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha)); + ct = gdImageColorAllocateAlpha(im, red, green, blue, alpha); + if (ct < 0) { + RETURN_FALSE; + } + + RETURN_LONG((long)ct); } /* }}} */