1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00

Merge branch 'PHP-7.1'

* PHP-7.1:
  Fix intermittent segfault in GD library
This commit is contained in:
Joe Watkins
2017-01-22 06:41:20 +00:00

View File

@@ -160,7 +160,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;
@@ -173,7 +173,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) {