all repos — mgba @ 54ea3dbbcf39eec26519a6ef8246bd1d9c0cdbb1

mGBA Game Boy Advance Emulator

Util: Fix setjmp buffer for PNG failing in PNGWriteHeader
Jeffrey Pfau jeffrey@endrift.com
Mon, 14 Sep 2015 23:26:20 -0700
commit

54ea3dbbcf39eec26519a6ef8246bd1d9c0cdbb1

parent

532261af2c689bb1fc1c722c5a58950fbaae8488

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/util/png-io.csrc/util/png-io.c

@@ -43,6 +43,9 @@ png_infop info = png_create_info_struct(png);

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;