diff -urp a/src/OpenPNG.cpp b/src/OpenPNG.cpp --- a/src/OpenPNG.cpp +++ b/src/OpenPNG.cpp @@ -5,6 +5,7 @@ */ +#include #include #include "Debug.h" #include "Open.h" @@ -38,9 +39,7 @@ namespace corona { void PNG_error_function(png_structp png_ptr, png_const_charp warning) { // copied from libpng's pngerror.cpp, but without the fprintf - jmp_buf jmpbuf; - memcpy(jmpbuf, png_ptr->jmpbuf, sizeof(jmp_buf)); - longjmp(jmpbuf, 1); + longjmp(png_jmpbuf(png_ptr), 1); } ////////////////////////////////////////////////////////////////////////////// diff -urp a/src/SavePNG.cpp b/src/SavePNG.cpp --- a/src/SavePNG.cpp +++ b/src/SavePNG.cpp @@ -1,4 +1,5 @@ #include +#include #include #include "Debug.h" #include "Save.h" @@ -145,7 +146,6 @@ namespace corona { pixels += width * color_format_bpp; } png_set_rows(png_ptr, info_ptr, (png_bytepp)rows); - info_ptr->valid |= PNG_INFO_IDAT; // actually write the image png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);