all repos — mgba @ a6911437773cadc3708f92b16813b3d635dc1d65

mGBA Game Boy Advance Emulator

Util: Fix regression with PNGs
Vicki Pfau vi@endrift.com
Mon, 16 Oct 2017 20:06:52 -0700
commit

a6911437773cadc3708f92b16813b3d635dc1d65

parent

b05cfe7764193a0ba11487675bb7e937df479504

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

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

@@ -47,16 +47,19 @@ if (setjmp(png_jmpbuf(png))) {

return 0; } png_set_IHDR(png, info, width, height, 8, type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - png_write_info(png, info); return info; } png_infop PNGWriteHeader(png_structp png, unsigned width, unsigned height) { - return _pngWriteHeader(png, width, height, PNG_COLOR_TYPE_RGB); + png_infop info = _pngWriteHeader(png, width, height, PNG_COLOR_TYPE_RGB); + png_write_info(png, info); + return info; } png_infop PNGWriteHeaderA(png_structp png, unsigned width, unsigned height) { - return _pngWriteHeader(png, width, height, PNG_COLOR_TYPE_RGB_ALPHA); + png_infop info = _pngWriteHeader(png, width, height, PNG_COLOR_TYPE_RGB_ALPHA); + png_write_info(png, info); + return info; } png_infop PNGWriteHeader8(png_structp png, unsigned width, unsigned height) {