X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2F3dengfx%2Fsrc%2Fgfx%2Fimage_png.c;h=47f165021819703de5aaa8b7e17d032d354d25f6;hb=21cb5f9bccf9d04d686e3126bfd7510dfa554d88;hp=1b0f75944c46221c73b3e37d720eacc39ccd7001;hpb=6e23259dbabaeb1711a2a5ca25b9cb421f693759;p=summerhack diff --git a/src/3dengfx/src/gfx/image_png.c b/src/3dengfx/src/gfx/image_png.c index 1b0f759..47f1650 100644 --- a/src/3dengfx/src/gfx/image_png.c +++ b/src/3dengfx/src/gfx/image_png.c @@ -51,6 +51,7 @@ void *load_png(FILE *fp, unsigned long *xsz, unsigned long *ysz) { png_info *info_ptr; int i; uint32_t **lineptr, *pixels; + uint32_t width, height; int channel_bits, color_type, ilace_type, compression, filtering; if(!(png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0))) { @@ -75,7 +76,9 @@ void *load_png(FILE *fp, unsigned long *xsz, unsigned long *ysz) { png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_BGR, 0); - png_get_IHDR(png_ptr, info_ptr, xsz, ysz, &channel_bits, &color_type, &ilace_type, &compression, &filtering); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &channel_bits, &color_type, &ilace_type, &compression, &filtering); + *xsz = width; + *ysz = height; pixels = malloc(*xsz * *ysz * sizeof(uint32_t)); lineptr = (uint32_t**)png_get_rows(png_ptr, info_ptr);