X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fcommon%2Freadpng.c;h=722dc26e729677c3c7420f6a8bc5c6ee8d14182d;hb=59d15d23d97d4347d8046057013f8979db0914f0;hp=540f54380abb4de4d8e302716e9ae53fb6554c1d;hpb=791f6e3e4764e93a81a6b57127d6d9673a7456e9;p=pcsx_rearmed.git diff --git a/frontend/common/readpng.c b/frontend/common/readpng.c index 540f5438..722dc26e 100644 --- a/frontend/common/readpng.c +++ b/frontend/common/readpng.c @@ -73,12 +73,12 @@ int readpng(void *dest, const char *fname, readpng_what what, int req_w, int req lprintf(__FILE__ ": bg image uses %ibpc, needed 8bpc\n", png_get_bit_depth(png_ptr, info_ptr)); break; } - height = png_get_image_width(png_ptr, info_ptr); - if (height > req_h) - height = req_h; - width = png_get_image_height(png_ptr, info_ptr); + width = png_get_image_width(png_ptr, info_ptr); if (width > req_w) width = req_w; + height = png_get_image_height(png_ptr, info_ptr); + if (height > req_h) + height = req_h; for (h = 0; h < height; h++) { @@ -164,12 +164,12 @@ int readpng(void *dest, const char *fname, readpng_what what, int req_w, int req lprintf(__FILE__ ": image uses %ibpc, needed 8bpc\n", png_get_bit_depth(png_ptr, info_ptr)); break; } - height = png_get_image_height(png_ptr, info_ptr); - if (height > req_h) - height = req_h; width = png_get_image_width(png_ptr, info_ptr); if (width > req_w) width = req_w; + height = png_get_image_height(png_ptr, info_ptr); + if (height > req_h) + height = req_h; for (h = 0; h < height; h++) {