summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gd/gd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 582e6a28c0..3585407390 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(imagecolorstotal)
Define a color as transparent */
PHP_FUNCTION(imagecolortransparent)
{
- zval **IM, **COL = NULL;
+ zval **IM, **COL;
gdImagePtr im;
int col;
GDLS_FETCH();
@@ -1414,9 +1414,8 @@ PHP_FUNCTION(imagecolortransparent)
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", GDG(le_gd));
- if (COL != NULL && (*COL) != NULL) {
- col = (*COL)->value.lval;
- gdImageColorTransparent(im,col);
+ if (ZEND_NUM_ARGS() > 1) {
+ gdImageColorTransparent(im, Z_LVAL_PP(COL));
}
col = gdImageGetTransparent(im);
RETURN_LONG(col);