pajoye Tue Jan 17 15:23:29 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/gd gd.c
Log:
- Returns FALSE on error, it is how it must work
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.312.2.12&r2=1.312.2.13&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.12 php-src/ext/gd/gd.c:1.312.2.13
--- php-src/ext/gd/gd.c:1.312.2.12 Sun Jan 1 12:50:06 2006
+++ php-src/ext/gd/gd.c Tue Jan 17 15:23:29 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.312.2.12 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: gd.c,v 1.312.2.13 2006/01/17 15:23:29 pajoye Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -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);
RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha));
+ ct = gdImageColorAllocateAlpha(im, red, green, blue, alpha);
+ if (ct < 0) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG((long)ct);
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php