From 54ea3dbbcf39eec26519a6ef8246bd1d9c0cdbb1 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 14 Sep 2015 23:26:20 -0700 Subject: [PATCH] Util: Fix setjmp buffer for PNG failing in PNGWriteHeader --- src/util/png-io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/png-io.c b/src/util/png-io.c index 3e0ca13b1..b18b64202 100644 --- a/src/util/png-io.c +++ b/src/util/png-io.c @@ -43,6 +43,9 @@ png_infop PNGWriteHeader(png_structp png, unsigned width, unsigned height) { if (!info) { return 0; } + if (setjmp(png_jmpbuf(png))) { + return 0; + } png_set_IHDR(png, info, width, height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); png_write_info(png, info); return info;