summaryrefslogtreecommitdiff
path: root/ext/gd/gd_ctx.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-02-02 13:23:16 +0800
committerXinchen Hui <laruence@gmail.com>2015-02-02 13:23:16 +0800
commit942809909e1bc125db038796c0a1a0b53eeaca7d (patch)
treebddec8b44878488fc73e8fe2fb9e30b7ee4f9b67 /ext/gd/gd_ctx.c
parentc9e44dc2dfa7ad91fe9253378a49e9f5b057992e (diff)
downloadphp-git-942809909e1bc125db038796c0a1a0b53eeaca7d.tar.gz
Cleanup resource handling APIs
Diffstat (limited to 'ext/gd/gd_ctx.c')
-rw-r--r--ext/gd/gd_ctx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 028a37e435..c848e438c7 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -103,7 +103,9 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
}
- ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", phpi_get_le_gd());
+ if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(imgind), "Image", phpi_get_le_gd())) == NULL) {
+ RETURN_FALSE;
+ }
if (argc >= 3) {
q = quality; /* or colorindex for foreground of BW images (defaults to black) */