aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2012-09-13 02:33:26 +0300
committernotaz2012-09-13 02:33:26 +0300
commit29ddd9e8a2bd7d3c8baf6023a05e8cf407bd2212 (patch)
tree45abf436aaf9ee07d130c0905ea44012d60551af
parent84365ca2e1751440f0af970abd3b8517ae97a055 (diff)
downloadpcsx_rearmed-29ddd9e8a2bd7d3c8baf6023a05e8cf407bd2212.tar.gz
pcsx_rearmed-29ddd9e8a2bd7d3c8baf6023a05e8cf407bd2212.tar.bz2
pcsx_rearmed-29ddd9e8a2bd7d3c8baf6023a05e8cf407bd2212.zip
frontend: readpng: fix width/height confusion
-rw-r--r--frontend/common/readpng.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/frontend/common/readpng.c b/frontend/common/readpng.c
index 540f543..722dc26 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++)
{