--- libsrc/irrlicht-0.14-patched/CImageLoaderPNG.cpp 2006-03-21 15:26:50.000000000 +0100 +++ libsrc/irrlicht-0.14-patched/CImageLoaderPNG.cpp-gil 2011-06-24 17:37:26.566129133 +0200 @@ -157,10 +157,17 @@ png_set_sig_bytes(png_ptr, 8); // Tell png that we read the signature png_read_info(png_ptr, info_ptr); // Read the info section of the png file - - png_get_IHDR(png_ptr, info_ptr, (png_uint_32*)&width, - (png_uint_32*)&height, &bitdepth, &colortype, &interlace, + + /* We MUST use these and not use the address of our width/height + attributes directly as png_uint_32 = 64 bits on 64 bits, brilliant + huh? */ + png_uint_32 temp_width, temp_height; + + png_get_IHDR(png_ptr, info_ptr, &temp_width, + &temp_height, &bitdepth, &colortype, &interlace, &compression, &filter); // Extract info + width = temp_width; + height = temp_height; if ( bitdepth != 8) { @@ -195,10 +202,13 @@ png_read_update_info(png_ptr, info_ptr); png_get_IHDR(png_ptr, info_ptr, - (png_uint_32*)&width, (png_uint_32*)&height, + &temp_width, &temp_height, &bitdepth,&colortype, &interlace, &compression, &filter); // Extract info + width = temp_width; + height = temp_height; + // Check the number of bytes per row int bytes_per_row = png_get_rowbytes(png_ptr, info_ptr);