Re: cvs: php-src(PHP_5_1) /ext/gd gd.c

From: Date: Tue, 17 Jan 2006 18:58:29 +0000
Subject: Re: cvs: php-src(PHP_5_1) /ext/gd gd.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-36548@lists.php.net to get a copy of this message
@@ -1095,6 +1095,7 @@ 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 @@ ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
you forgot to remove the line below:
RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha));
+ ct = gdImageColorAllocateAlpha(im, red, green, blue, alpha); + if (ct < 0) { + RETURN_FALSE; + } + + RETURN_LONG((long)ct); } /* }}} */
Nuno

« previous php.cvs (#36548) next »