]> granicus.if.org Git - php/commitdiff
- fix crash when argc > 1 and to_zval is NULL (thx tony for the headup)
authorPierre Joye <pajoye@php.net>
Mon, 3 Jan 2011 15:35:01 +0000 (15:35 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 3 Jan 2011 15:35:01 +0000 (15:35 +0000)
ext/gd/gd_ctx.c

index eb7c29920338cd8696ae88a8a8876881e245f4b3..7be95d02908a78144c931e2857dd3b1cc316bfbc 100644 (file)
@@ -118,7 +118,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
                }
        }
 
-       if (argc > 1) {
+       if (argc > 1 && to_zval) {
                if (Z_TYPE_P(to_zval) == IS_RESOURCE) {
                        php_stream_from_zval_no_verify(stream, &to_zval);
                        if (stream == NULL) {