X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef3ab009984534c308ca0ee94cd3fcbccdc63448..b4fe51258d17c1e63c55b2b83c8db83e44b15927:/src/msw/pnghand.cpp diff --git a/src/msw/pnghand.cpp b/src/msw/pnghand.cpp index 7b83b89a4e..9e1d34945c 100644 --- a/src/msw/pnghand.cpp +++ b/src/msw/pnghand.cpp @@ -386,35 +386,30 @@ wxMask *wxPNGReader::CreateMask() bool wxPNGReader::ReadFile(wxChar * ImageFileName) { - int number_passes; - if (ImageFileName) wxStrcpy(filename, ImageFileName); - FILE *fp; - png_struct *png_ptr; - png_info *info_ptr; - /* open the file */ - fp = fopen(wxConvFile.cWX2MB(filename), "rb"); + FILE *fp = fopen(wxConvFile.cWX2MB(filename), "rb"); if (!fp) return FALSE; /* allocate the necessary structures */ - png_ptr = new (png_struct); + png_struct *png_ptr = new (png_struct); if (!png_ptr) { fclose(fp); return FALSE; } - info_ptr = new (png_info); + png_info *info_ptr = new (png_info); if (!info_ptr) { fclose(fp); delete(png_ptr); return FALSE; } + /* set error handling */ if (setjmp(png_ptr->jmpbuf)) { @@ -478,6 +473,7 @@ bool wxPNGReader::ReadFile(wxChar * ImageFileName) byte *row_pointers = new byte[row_stride]; /* turn on interlace handling */ + int number_passes; if (info_ptr->interlace_type) number_passes = png_set_interlace_handling(png_ptr); else