X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e0589e873169b5983c7b7f4c2bdd38b18b4a674..75b324211c094aea8373e3e6b7846e78b7befb89:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index ab10f4b9e9..1d8a97046d 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -508,13 +508,16 @@ wxPNGHandler::LoadFile(wxImage *image, bool verbose, int WXUNUSED(index)) { - // VZ: as this function uses setjmp() the only fool proof error handling + // VZ: as this function uses setjmp() the only fool-proof error handling // method is to use goto (setjmp is not really C++ dtors friendly...) unsigned char **lines = NULL; png_infop info_ptr = (png_infop) NULL; wxPNGInfoStruct wxinfo; + png_uint_32 i, width, height = 0; + int bit_depth, color_type, interlace_type; + wxinfo.verbose = verbose; wxinfo.stream.in = &stream; @@ -541,9 +544,6 @@ wxPNGHandler::LoadFile(wxImage *image, if (setjmp(wxinfo.jmpbuf)) goto error; - png_uint_32 i, width, height = 0; - int bit_depth, color_type, interlace_type; - png_read_info( png_ptr, info_ptr ); png_get_IHDR( png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, (int*) NULL, (int*) NULL );