PNG portability fixes.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 21 May 2011 09:03:51 +0000 (10:03 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 21 May 2011 09:06:07 +0000 (10:06 +0100)
image.cpp

index 1f96c29..922c4d4 100644 (file)
--- a/image.cpp
+++ b/image.cpp
@@ -24,6 +24,7 @@
  **************************************************************************/
 
 
+#include <zlib.h>
 #include <png.h>
 
 #include <math.h>
@@ -319,7 +320,7 @@ struct png_tmp_buffer
 static void
 pngWriteCallback(png_structp png_ptr, png_bytep data, png_size_t length)
 {
-    struct png_tmp_buffer *buf = (struct png_tmp_buffer*) png_ptr->io_ptr;
+    struct png_tmp_buffer *buf = (struct png_tmp_buffer*) png_get_io_ptr(png_ptr);
     size_t nsize = buf->size + length;
 
     /* allocate or grow buffer */