tags 442631 + patch
thanks

Hello,

On Sat, 22 Sep 2007, Kapil Hari Paranjape wrote:
> > $ pngcrush -itxt Comment foo bar.png
> > Warning: versions are different between png.h and png.c
> >   png.h version: 1.2.13
> >   png.c version: 1.2.15beta5
> > 
> > Segmentation fault (core dumped)

This is due to an error in handling parameters for -itxt. Since there
are a couple of other fixes in the pipeline the package update may
take longer than some people can wait. So a patch is enclosed.

Regards,

Kapil.
--

Index: pngcrush-1.6.4/pngcrush.c
===================================================================
--- pngcrush-1.6.4.orig/pngcrush.c      2007-09-23 08:43:03.000000000 +0530
+++ pngcrush-1.6.4/pngcrush.c   2007-09-23 08:45:35.000000000 +0530
@@ -1827,7 +1827,7 @@
                 if (!strncmp(argv[i], "-zi", 3)) {
                     text_compression[text_inputs] =
                         PNG_ITXT_COMPRESSION_zTXt;
-                    names += 2;
+                    /* names += 2; */
                 } else
 #endif
                 if (!strncmp(argv[i], "-z", 2))
@@ -1840,7 +1840,7 @@
                 else {
                     text_compression[text_inputs] =
                         PNG_ITXT_COMPRESSION_NONE;
-                    names += 2;
+                    /* names += 2; */
                 }
 #endif
                 names += 3;
@@ -1854,6 +1854,10 @@
                     text_lang[text_inputs * 80] = '\0';
                     text_lang_key[text_inputs * 80] = '\0';
                 } else {
+                    i += 2;
+                    BUMP_I;
+                    i -= 3;
+                    names += 2;
                     strcpy(&text_lang[text_inputs * 80], argv[++i]);
                     /* libpng-1.0.5j and later */
                     strcpy(&text_lang_key[text_inputs * 80], argv[++i]);

Attachment: signature.asc
Description: Digital signature

Reply via email to