|
|
907c665 |
--- bolzplatz2006/libsrc/irrlicht-0.14-patched/CImageLoaderPNG.cpp~ 2007-09-07 21:58:09.000000000 +0200
|
|
|
907c665 |
+++ bolzplatz2006/libsrc/irrlicht-0.14-patched/CImageLoaderPNG.cpp 2007-09-07 22:08:27.000000000 +0200
|
|
|
907c665 |
@@ -157,10 +157,17 @@ IImage* CImageLoaderPng::loadImage(irr::
|
|
|
907c665 |
png_set_sig_bytes(png_ptr, 8); // Tell png that we read the signature
|
|
|
907c665 |
|
|
|
907c665 |
png_read_info(png_ptr, info_ptr); // Read the info section of the png file
|
|
|
907c665 |
+
|
|
|
907c665 |
+ /* We MUST use these and not use the address of our width/height
|
|
|
907c665 |
+ attributes directly as png_uint_32 = 64 bits on 64 bits, brilliant
|
|
|
907c665 |
+ huh? */
|
|
|
907c665 |
+ png_uint_32 temp_width, temp_height;
|
|
|
907c665 |
|
|
|
907c665 |
- png_get_IHDR(png_ptr, info_ptr, (png_uint_32*)&width,
|
|
|
907c665 |
- (png_uint_32*)&height, &bitdepth, &colortype, &interlace,
|
|
|
907c665 |
+ png_get_IHDR(png_ptr, info_ptr, &temp_width,
|
|
|
907c665 |
+ &temp_height, &bitdepth, &colortype, &interlace,
|
|
|
907c665 |
&compression, &filter); // Extract info
|
|
|
907c665 |
+ width = temp_width;
|
|
|
907c665 |
+ height = temp_height;
|
|
|
907c665 |
|
|
|
907c665 |
if ( bitdepth != 8)
|
|
|
907c665 |
{
|
|
|
907c665 |
@@ -206,10 +213,13 @@ IImage* CImageLoaderPng::loadImage(irr::
|
|
|
907c665 |
png_read_update_info(png_ptr, info_ptr);
|
|
|
907c665 |
|
|
|
907c665 |
png_get_IHDR(png_ptr, info_ptr,
|
|
|
907c665 |
- (png_uint_32*)&width, (png_uint_32*)&height,
|
|
|
907c665 |
+ &temp_width, &temp_height,
|
|
|
907c665 |
&bitdepth,&colortype, &interlace, &compression,
|
|
|
907c665 |
&filter); // Extract info
|
|
|
907c665 |
|
|
|
907c665 |
+ width = temp_width;
|
|
|
907c665 |
+ height = temp_height;
|
|
|
907c665 |
+
|
|
|
907c665 |
// Check the number of bytes per row
|
|
|
907c665 |
int bytes_per_row = png_get_rowbytes(png_ptr, info_ptr);
|
|
|
907c665 |
|