Thu Jan 13 17:07:54 2011 UTC ()
Fix build with png-1.5.


(wiz)
diff -r1.9 -r1.10 pkgsrc/graphics/gif2png/distinfo
diff -r0 -r1.5 pkgsrc/graphics/gif2png/patches/patch-aa

cvs diff -r1.9 -r1.10 pkgsrc/graphics/gif2png/distinfo (expand / switch to unified diff)

--- pkgsrc/graphics/gif2png/distinfo 2010/01/20 14:30:28 1.9
+++ pkgsrc/graphics/gif2png/distinfo 2011/01/13 17:07:53 1.10
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
1$NetBSD: distinfo,v 1.9 2010/01/20 14:30:28 wiz Exp $ 1$NetBSD: distinfo,v 1.10 2011/01/13 17:07:53 wiz Exp $
2 2
3SHA1 (gif2png-2.5.2.tar.gz) = 0e9e66d6728fe7e2dcde61ad0e398a60894946b3 3SHA1 (gif2png-2.5.2.tar.gz) = 0e9e66d6728fe7e2dcde61ad0e398a60894946b3
4RMD160 (gif2png-2.5.2.tar.gz) = a361b18af23e59b73121ae25a155b54fb62eb14a 4RMD160 (gif2png-2.5.2.tar.gz) = a361b18af23e59b73121ae25a155b54fb62eb14a
5Size (gif2png-2.5.2.tar.gz) = 171740 bytes 5Size (gif2png-2.5.2.tar.gz) = 171740 bytes
 6SHA1 (patch-aa) = ae26b928890c0d7577a0889ae21f6f836faa71b1

File Added: pkgsrc/graphics/gif2png/patches/Attic/patch-aa
$NetBSD: patch-aa,v 1.5 2011/01/13 17:07:53 wiz Exp $

Fix build with png-1.5.

--- gif2png.c.orig	2009-11-11 20:28:02.000000000 +0000
+++ gif2png.c
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>	/* for isatty() */
+#include <zlib.h>
 
 #if !defined(TRUE)
 #define FALSE	0
@@ -120,8 +121,8 @@ int writefile(struct GIFelement *s,struc
     int colors_used = 0;
     byte remap[MAXCMSIZE];
     int low_prec;
-    png_struct *png_ptr = xalloc(sizeof (png_struct));
-    png_info *info_ptr = xalloc(sizeof (png_info));
+    png_struct *png_ptr;
+    png_info *info_ptr;
     int p;
     int gray_bitdepth;
     png_color pal_rgb[MAXCMSIZE], *pltep;
@@ -136,6 +137,19 @@ int writefile(struct GIFelement *s,struc
     png_text software;
     png_text comment;
 
+    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+    if (png_ptr == NULL) {
+      fprintf(stderr, "gif2png: fatal error, out of memory\n");
+      fprintf(stderr, "gif2png: exiting ungracefully\n");
+      exit(1);
+    }
+    info_ptr = png_create_info_struct(png_ptr);
+    if (info_ptr == NULL) {
+      fprintf(stderr, "gif2png: fatal error, out of memory\n");
+      fprintf(stderr, "gif2png: exiting ungracefully\n");
+      exit(1);
+    }
+
     /* these volatile declarations prevent gcc warnings ("variable might be
      *  clobbered by `longjmp' or `vfork'") */
     volatile int gray = TRUE;