summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch')
-rw-r--r--sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch b/sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch
new file mode 100644
index 000000000000..92b117a377a9
--- /dev/null
+++ b/sci-misc/gcam/files/gcam-2010.07.27-libpng15.patch
@@ -0,0 +1,34 @@
+diff -ruN gcam-2010.07.27.orig/libgcode/gcode_image.c gcam-2010.07.27/libgcode/gcode_image.c
+--- gcam-2010.07.27.orig/libgcode/gcode_image.c 2010-07-23 17:15:13.000000000 +0200
++++ gcam-2010.07.27/libgcode/gcode_image.c 2012-01-08 20:07:35.000000000 +0100
+@@ -260,8 +260,8 @@
+
+ png_read_info (png_ptr, info_ptr);
+
+- image->res[0] = info_ptr->width;
+- image->res[1] = info_ptr->height;
++ image->res[0] = png_get_image_width(png_ptr, info_ptr);
++ image->res[1] = png_get_image_height(png_ptr, info_ptr);
+
+ /* printf ("image size: %dx%d\n", image->res[0], image->res[1]); */
+
+@@ -274,16 +274,16 @@
+
+ row_pointers = (png_bytep *) malloc (sizeof (png_bytep) * image->res[1]);
+ for (y = 0; y < image->res[1]; 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);
+
+ image->dmap = (gfloat_t *) malloc (sizeof (gfloat_t) * image->res[0] * image->res[1]);
+
+ incr = 1;
+- if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_COLOR)
+ incr = 3;
+- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
+ incr = 4;
+
+ for (y = 0; y < image->res[1]; y++)