$OpenBSD$
--- src/MakeData.cpp.orig Thu Oct 27 20:05:40 2011
+++ src/MakeData.cpp Thu Oct 27 20:09:28 2011
@@ -109,10 +109,10 @@ struct PngFile {
png_read_info(png_ptr, info_ptr);
- width = info_ptr->width;
- height = info_ptr->height;
- color_type = info_ptr->color_type;
- bit_depth = info_ptr->bit_depth;
+ int width = png_get_image_width(png_ptr, info_ptr);
+ height = png_get_image_height(png_ptr, info_ptr);
+ color_type = png_get_color_type(png_ptr, info_ptr);
+ bit_depth = png_get_bit_depth(png_ptr, info_ptr);
number_of_passes = png_set_interlace_handling(png_ptr);
png_read_update_info(png_ptr, info_ptr);
@@ -125,7 +125,7 @@ struct PngFile {
row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height);
for (int y=0; y<height; y++)
- row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes);
+ row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr));
png_read_image(png_ptr, row_pointers);