From 328c294569b35d61d1ab8b6eb81763417f625035 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 17 Jan 2006 15:23:29 +0000 Subject: [PATCH] - Returns FALSE on error, it is how it must work --- ext/gd/gd.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); } /* }}} */ -- 2.40.0