Browse Source
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fix intermittent segfault in GD library
pull/2357/head
Joe Watkins
10 years ago
No known key found for this signature in database
GPG Key ID: F9BA0ADA31CBD89E
1 changed files with
2 additions and
2 deletions
-
ext/gd/gd_ctx.c
|
|
|
@ -152,7 +152,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, |
|
|
|
RETURN_FALSE; |
|
|
|
} |
|
|
|
} else { |
|
|
|
ctx = emalloc(sizeof(gdIOCtx)); |
|
|
|
ctx = ecalloc(1, sizeof(gdIOCtx)); |
|
|
|
ctx->putC = _php_image_output_putc; |
|
|
|
ctx->putBuf = _php_image_output_putbuf; |
|
|
|
ctx->gd_free = _php_image_output_ctxfree; |
|
|
|
@ -165,7 +165,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, |
|
|
|
} |
|
|
|
|
|
|
|
if (!ctx) { |
|
|
|
ctx = emalloc(sizeof(gdIOCtx)); |
|
|
|
ctx = ecalloc(1, sizeof(gdIOCtx)); |
|
|
|
ctx->putC = _php_image_stream_putc; |
|
|
|
ctx->putBuf = _php_image_stream_putbuf; |
|
|
|
if (close_stream) { |
|
|
|
|