$NetBSD: patch-aa,v 1.3 2006/04/18 12:56:03 tron Exp $

--- gif2png.c.orig	2002-05-10 15:06:02.000000000 +0100
+++ gif2png.c	2006-04-18 13:52:45.000000000 +0100
@@ -135,7 +135,7 @@
     unsigned long hist_maxvalue;
     int passcount;
     int errtype, errorcount = 0;
-    png_text software;
+    png_text comment, software;
 
     /* these volatile declarations prevent gcc warnings ("variable might be
      *  clobbered by `longjmp' or `vfork'") */
@@ -517,11 +517,15 @@
 	    j = s->size;
 	    if (j > 0 && data[j-1] == '\0')  /* some apps include a NULL in GIF comment */
 		--j;
-	    if (j<500) {
-		png_write_tEXt(png_ptr, "Comment", (png_charp)data, j);
-	    } else {
-		png_write_zTXt(png_ptr, "Comment", (png_charp)data, j, 0);
-	    }
+	    if (j<1000)
+		comment.compression = PNG_TEXT_COMPRESSION_NONE;
+	    else
+		comment.compression = PNG_TEXT_COMPRESSION_zTXt;
+	    comment.key = "Comment";
+	    comment.text = data;
+	    comment.text_length = j;
+
+	    png_set_text(png_ptr, info_ptr, &comment, 1);
 	    break;
 
 	case GIFapplication:
