openbsd-ports/graphics/mhgui/patches/patch-src_ImageData_cpp
naddy eed7c62887 Fix build with png-1.5.
All fixes by yours truly.
2011-07-08 20:38:00 +00:00

27 lines
848 B
Plaintext

$OpenBSD: patch-src_ImageData_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $
Fix build with png-1.5.
--- src/ImageData.cpp.orig Tue Jul 5 21:52:52 2011
+++ src/ImageData.cpp Tue Jul 5 21:56:08 2011
@@ -370,6 +370,7 @@ bool ImageData::pngLoadPNGLib (const string& filename)
char sig[8]; /* PNG signature array */
+ unsigned int w, h;
int bit_depth;
int color_type;
@@ -454,8 +455,10 @@ bool ImageData::pngLoadPNGLib (const string& filename)
// read all the info up to the image data
png_read_info(png_ptr, info_ptr);
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
+ png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth,
&color_type, NULL, NULL, NULL);
+ width = w;
+ height = h;
// Set up some transforms.
if (color_type & PNG_COLOR_MASK_ALPHA)