Hello community,

here is the log from the commit of package pngcrush for openSUSE:Factory 
checked in at 2015-03-27 09:41:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pngcrush (Old)
 and      /work/SRC/openSUSE:Factory/.pngcrush.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pngcrush"

Changes:
--------
--- /work/SRC/openSUSE:Factory/pngcrush/pngcrush.changes        2015-03-03 
11:16:15.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.pngcrush.new/pngcrush.changes   2015-03-27 
09:41:26.000000000 +0100
@@ -1,0 +2,11 @@
+Wed Mar 25 13:52:26 UTC 2015 - [email protected]
+
+- updated to 1.7.85
+  - Improved reporting of invalid chunk names. Does not try to put
+    non-printable characters in STDERR; displays hex numbers instead.
+  - Fixed include path for utime.h on MSVC (Louis McLaughlin).
+  - Eliminated "FAR" memory support (it was removed from libpng at version 
1.6.0).
+  - Disabled the "-already_crushed" option which does not really work well.
+
+
+-------------------------------------------------------------------

Old:
----
  pngcrush-1.7.84.tar.gz

New:
----
  pngcrush-1.7.85.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pngcrush.spec ++++++
--- /var/tmp/diff_new_pack.9j2ugX/_old  2015-03-27 09:41:26.000000000 +0100
+++ /var/tmp/diff_new_pack.9j2ugX/_new  2015-03-27 09:41:26.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           pngcrush
-Version:        1.7.84
+Version:        1.7.85
 Release:        0
 Summary:        Optimizer for PNG Files that can also insert or delete 
specified Chunks
 License:        Zlib

++++++ pngcrush-1.7.84.tar.gz -> pngcrush-1.7.85.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pngcrush-1.7.84/ChangeLog.html 
new/pngcrush-1.7.85/ChangeLog.html
--- old/pngcrush-1.7.84/ChangeLog.html  2015-02-28 16:38:54.000000000 +0100
+++ new/pngcrush-1.7.85/ChangeLog.html  2015-03-09 20:29:23.000000000 +0100
@@ -3,10 +3,21 @@
 
 Change log:
 
-Version 1.7.84beta (built with libpng-1.7.0beta47 and zlib-1.2.8)
+Version 1.7.85 (built with libpng-1.6.16 and zlib-1.2.8)
+  Improved reporting of invalid chunk names. Does not try to put
+    non-printable characters in STDERR; displays hex numbers instead.
+  Fixed include path for utime.h on MSVC (Louis McLaughlin).
+  Eliminated "FAR" memory support (it was removed from libpng at version
+    1.6.0).
+  Disabled the "-already_crushed" option which does not really work well.
+
+Version 1.7.84 (built with libpng-1.6.16 and zlib-1.2.8)
+  Cleaned up more Coverity-scan warnings. Fixing those also fixed
+    CVE-2015-2158.
 
 Version 1.7.83 (built with libpng-1.6.16 and zlib-1.2.8)
-  Cleaned up some Coverity-scan warnings.
+  Cleaned up some Coverity-scan warnings.  Unfortunately one of these
+    changes introduced the vulnerability reported in CVE-2015-2158.
 
 Version 1.7.82 (built with libpng-1.6.16 and zlib-1.2.8)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pngcrush-1.7.84/Makefile new/pngcrush-1.7.85/Makefile
--- old/pngcrush-1.7.84/Makefile        2015-02-27 05:00:36.000000000 +0100
+++ new/pngcrush-1.7.85/Makefile        2015-03-06 12:24:23.000000000 +0100
@@ -24,8 +24,6 @@
 # Work around zlib compiler bug in 1.2.6
 CPPFLAGS += -DZ_SOLO
 
-CPPFLAGS += -DWBITS_8_OK
-
 # Cannot use this with libpng15 and later.
 # TOOFAR_OK=-DINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 TOOFAR_OK=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pngcrush-1.7.84/pngcrush.c 
new/pngcrush-1.7.85/pngcrush.c
--- old/pngcrush-1.7.84/pngcrush.c      2015-02-28 16:32:14.000000000 +0100
+++ new/pngcrush-1.7.85/pngcrush.c      2015-03-09 20:03:01.000000000 +0100
@@ -28,9 +28,6 @@
  * Thanks to Stephan Levavej for some helpful suggestions about gcc compiler
  * options and for a suggestion to increase the Z_MEM_LEVEL from default.
  *
- */
-
-/*
  * CAUTION:
  *
  * There is another version of pngcrush that has been distributed by
@@ -80,7 +77,7 @@
  *
  */
 
-#define PNGCRUSH_VERSION "1.7.84"
+#define PNGCRUSH_VERSION "1.7.85"
 
 /* Experimental: define these if you wish, but, good luck.
 #define PNGCRUSH_COUNT_COLORS
@@ -159,7 +156,9 @@
  *   in pngcrush are already available in ImageMagick; you can try a
  *   workflow that makes a first pass over the image with ImageMagick
  *   to select the bit depth, color type, interlacing, etc., and then makes
- *   another pass with pngcrush to optimize the compression.)
+ *   another pass with pngcrush to optimize the compression, and finally
+ *   makes a pass with libpng's "pngfix" app to optimize the zlib CMF
+ *   bytes.)
  *
  *   1. Reset CINFO to reflect decoder's required window size (instead of
  *   libz-1.1.3 encoder's required window size, which is 262 bytes larger).
@@ -172,7 +171,8 @@
  *   CINFO properly is to provide the *decoder* with information that will
  *   allow it to request only the minimum amount of memory required to decode
  *   the image (note that libpng-based decoders don't make use of this
- *   hint until libpng-1.6.0).
+ *   hint, because of the large number of files found in the wild that have
+ *   incorrect CMF bytes).
  *
  *   In the meantime, one can just run
  *
@@ -209,15 +209,17 @@
  *      settings, then attempt to decode the zlib datastream, and choose
  *      the smallest setting whose datastream can still be decoded
  *      successfully.  This is likely to be the simplest and fastest
- *      solution; however, it will only work with libpng-1.6.0 and later,
- *      where the decoder actually uses the CINFO hint.
+ *      solution; however, it will only work with a version of libpng
+ *      in which the decoder actually uses the CINFO hint.
  *      This seems to be the only method that would work with zopfli
  *      compression which always writes "7" (i.e., a 32k window) in CINFO.
  *
- *      d. The simplest way might be to simply try all window sizes
- *      for all methods, just as the "pc" script above does.  This of
- *      course involves a lot more trial compressions, but it will catch
- *      those instances where a smaller file will result.  Expensive.
+ *      d. The simplest is to use pngfix, which comes with libpng16 and
+ *      later, as a final step:
+ *
+ *           pngcrush input.png temp.png
+ *           pngfix --optimize --out=output.png temp.png
+ *           # TO DO: find out if this works with zopfli output
  *
  *   2. Check for the possiblity of using the tRNS chunk instead of
  *      the full alpha channel.  If all of the transparent pixels are
@@ -246,7 +248,8 @@
  *   achieves better compression.  It is Apache-2.0 licensed and available from
  *   a GIT repository at SourceForge (see https://code.google.com/p/zopfli/).
  *   See also the "pngzop" directory under the pmt.sourceforge.net project.
- *   Note paragraph 1.c above; zopfli always writes "7" in CINFO.
+ *   Note paragraph 1.c above; zopfli always writes "7" in CINFO.  See
+ *   my "pmt/pngzop" project at SourceForge.
  *
  *   5. Optionally recognize any sRGB iCCP profile and replace it with the
  *   sRGB chunk.  Turn this option on if the "-reduce" option is on.  Also,
@@ -308,10 +311,21 @@
 
 Change log:
 
-Version 1.7.84beta (built with libpng-1.7.0beta47 and zlib-1.2.8)
+Version 1.7.85 (built with libpng-1.6.16 and zlib-1.2.8)
+  Improved reporting of invalid chunk names. Does not try to put
+    non-printable characters in STDERR; displays hex numbers instead.
+  Fixed include path for utime.h on MSVC (Louis McLaughlin).
+  Eliminated "FAR" memory support (it was removed from libpng at version
+    1.6.0).
+  Disabled the "-already_crushed" option which does not really work well.
+
+Version 1.7.84 (built with libpng-1.6.16 and zlib-1.2.8)
+  Cleaned up more Coverity-scan warnings. Fixing those also fixed
+    CVE-2015-2158.
 
 Version 1.7.83 (built with libpng-1.6.16 and zlib-1.2.8)
-  Cleaned up some Coverity-scan warnings.
+  Cleaned up some Coverity-scan warnings.  Unfortunately one of these
+    changes introduced the vulnerability reported in CVE-2015-2158.
 
 Version 1.7.82 (built with libpng-1.6.16 and zlib-1.2.8)
 
@@ -1249,14 +1263,6 @@
 #  define PNG_ABORT abort();
 #endif
 
-#if 0
-#if (PNG_LIBPNG_VER < 10500)
-/* Suppress pedantic warnings in libpng-1.4.x */
-#undef PNG_NORETURN
-#define PNG_NORETURN /* This function does not return */
-#endif
-#endif
-
 #if (PNG_LIBPNG_VER < 10500)
 /* Two macros to return the first row and first column of the original,
  * full, image which appears in a given pass.  'pass' is in the range 0
@@ -1307,29 +1313,14 @@
    /* The following became unavailable in libpng16 (and were
     * deprecated in libpng14 and 15)
     */
-#  ifdef   USE_FAR_KEYWORD
-     /*   Use this to make far-to-near assignments */
-#    define CHECK   1
-#    define NOCHECK 0
-#    define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
-#    define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
-#    define png_memcmp  _fmemcmp    /* SJT: added */
-#    define png_memcpy  _fmemcpy
-#    define png_memset  _fmemset
+#  ifdef _WINDOWS_  /* Favor Windows over C runtime fns */
+#    define png_memcmp  memcmp
+#    define png_memcpy  CopyMemory
+#    define png_memset  memset
 #  else
-#    ifdef _WINDOWS_  /* Favor Windows over C runtime fns */
-#      define CVT_PTR(ptr)         (ptr)
-#      define CVT_PTR_NOCHECK(ptr) (ptr)
-#      define png_memcmp  memcmp
-#      define png_memcpy  CopyMemory
-#      define png_memset  memset
-#    else
-#      define CVT_PTR(ptr)         (ptr)
-#      define CVT_PTR_NOCHECK(ptr) (ptr)
-#      define png_memcmp  memcmp      /* SJT: added */
-#      define png_memcpy  memcpy
-#      define png_memset  memset
-#    endif
+#    define png_memcmp  memcmp      /* SJT: added */
+#    define png_memcpy  memcpy
+#    define png_memset  memset
 #  endif
 #endif /* PNGCRUSH_LIBPNG_VER >= 10500 */
 
@@ -1556,7 +1547,11 @@
 #ifndef __riscos
 #  include <sys/types.h>
 #  include <sys/stat.h>
-#  include <utime.h>
+#  ifndef _MSC_VER
+#    include <utime.h>
+#  else
+#    include <sys/utime.h>
+#  endif
 #endif
 
 #include <stdio.h>
@@ -1884,8 +1879,12 @@
 static float t_start, t_stop, t_decode, t_encode, t_misc;
 
 static png_uint_32 max_idat_size = MAX_IDAT_SIZE; /* increases the IDAT size */
+
+#if 0 /* disabled */
 static png_uint_32 crushed_idat_size = 0x3ffffffL;
 static int already_crushed = 0;
+#endif
+
 int ia;
 
 #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
@@ -2116,26 +2115,18 @@
  * read_data function and use it at run time with png_set_read_fn(), rather
  * than changing the library.
  */
-#ifndef USE_FAR_KEYWORD
 void PNGCBAPI pngcrush_default_read_data(png_structp png_ptr, png_bytep data,
    png_size_t length)
 {
    png_FILE_p io_ptr;
-#ifdef __COVERITY__
-   png_size_t i;
-#endif
-
-   io_ptr = png_get_io_ptr(png_ptr);
 
    if (length == 0)
       png_error(png_ptr, "Read Error: invalid length requested");
 
-#if 1
-   clearerr(io_ptr);
+   io_ptr = png_get_io_ptr(png_ptr);
 
    if (fileno(io_ptr) == -1)
       png_error(png_ptr, "Read Error: invalid io_ptr");
-#endif
 
    /*
     * fread() returns 0 on error, so it is OK to store this in a png_size_t
@@ -2144,7 +2135,6 @@
    if ((png_size_t)fread((void *)data, sizeof (png_byte), length,
         io_ptr) != length)
    {
-      clearerr(io_ptr);
       png_error(png_ptr, "Read Error: invalid length returned");
 #if PNG_LIBPNG_VER >= 10700
       PNG_ABORT
@@ -2153,7 +2143,8 @@
 #endif
    }
 
-#if 1
+   clearerr(io_ptr);
+
    if (ferror(io_ptr))
    {
       clearerr(io_ptr);
@@ -2167,79 +2158,7 @@
    }
 
    clearerr(io_ptr);
-#endif
-
-#ifdef __COVERITY__
-   /* Attempt to get Coverity to accept data */
-   for (i = 0; i < length; i++)
-   {
-      data[i] &= 0xff;
-   }
-#endif
 }
-#else /* USE_FAR_KEYWORD */
-/*
- * This is the model-independent version. Since the standard I/O library
- * can't handle far buffers in the medium and small models, we have to copy
- * the data.
- */
-
-#define NEAR_BUF_SIZE 1024
-#define MIN(a,b) (a <= b ? a : b)
-
-static void /* PRIVATE */
-pngcrush_default_read_data(png_structp png_ptr, png_bytep data,
-   png_size_t length)
-{
-   int check;
-   png_byte *n_data;
-   png_FILE_p io_ptr;
-
-   /* Check if data really is near. If so, use usual code. */
-   n_data = (png_byte *)CVT_PTR_NOCHECK(data);
-   io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr);
-   if ((png_bytep)n_data == data)
-   {
-      check = fread((void *)n_data, 1, length, io_ptr);
-   }
-   else
-   {
-      png_byte buf[NEAR_BUF_SIZE];
-      png_size_t read, remaining, err;
-      check = 0;
-      remaining = length;
-      do
-      {
-         read = MIN(NEAR_BUF_SIZE, remaining);
-         err = fread((void *)buf, (png_size_t)1, read, io_ptr);
-         png_memcpy(data, buf, read); /* copy far buffer to near buffer */
-         if(err != read)
-            break;
-         else
-            check += err;
-         data += read;
-         remaining -= read;
-      }
-      while (remaining != 0);
-   }
-   if ((png_uint_32)check != (png_uint_32)length)
-      png_error(png_ptr, "read Error");
-#if 0
-   if (salvage)
-   {
-     if (found_IDAT == 1)
-     {
-        /* replace first two bytes */
-        printf("  Input CMF = 0x%x,0x%x\n",buf[0],buf[1]);
-        found_IDAT++;
-     }
-     if (length==4)
-        if (buf[0] == 'I' && buf[1] == 'D' && buf[2] == 'A' && buf[3] == 'T')
-          found_IDAT++;
-   }
-#endif
-}
-#endif /* USE_FAR_KEYWORD */
 #endif /* PNG_STDIO_SUPPORTED */
 
 #ifdef PNG_STDIO_SUPPORTED
@@ -2249,7 +2168,6 @@
  * write_data function and use it at run time with png_set_write_fn(), rather
  * than changing the library.
  */
-#ifndef USE_FAR_KEYWORD
 void PNGCBAPI pngcrush_default_write_data(png_structp png_ptr, png_bytep data,
    png_size_t length)
 {
@@ -2262,55 +2180,6 @@
    if (check != length)
       png_error(png_ptr, "Write Error");
 }
-#else /* USE_FAR_KEYWORD */
-/*
- * This is the model-independent version. Since the standard I/O library
- * can't handle far buffers in the medium and small models, we have to copy
- * the data.
-*/
-
-#define NEAR_BUF_SIZE 1024
-#define MIN(a,b) (a <= b ? a : b)
-
-void PNGCBAPI pngcrush_default_write_data(png_structp png_ptr, png_bytep data,
-   png_size_t length)
-{
-   png_uint_32 check;
-   png_byte *near_data;  /* Needs to be "png_byte *" instead of "png_bytep" */
-   png_FILE_p io_ptr;
-
-   /* Check if data really is near. If so, use usual code. */
-   near_data = (png_byte *)CVT_PTR_NOCHECK(data);
-   io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(io_ptr));
-   if ((png_bytep)near_data == data)
-   {
-      check = fwrite(near_data, 1, length, io_ptr);
-   }
-   else
-   {
-      png_byte buf[NEAR_BUF_SIZE];
-      png_size_t written, remaining, err;
-      check = 0;
-      remaining = length;
-      do
-      {
-         written = MIN(NEAR_BUF_SIZE, remaining);
-         png_memcpy(buf, data, written); /* copy far buffer to near buffer */
-         err = fwrite(buf, 1, written, io_ptr);
-         if (err != written)
-            break;
-         else
-            check += err;
-         data += written;
-         remaining -= written;
-      }
-      while (remaining != 0);
-   }
-   if (check != length)
-      png_error(png_ptr, "Write Error");
-}
-
-#endif /* USE_FAR_KEYWORD */
 #endif /* PNG_STDIO_SUPPORTED */
 
 static void pngcrush_warning(png_structp png_ptr,
@@ -2378,9 +2247,9 @@
 typedef struct memory_information {
     png_uint_32 size;
     png_voidp pointer;
-    struct memory_information FAR *next;
+    struct memory_information *next;
 } memory_information;
-typedef memory_information FAR *memory_infop;
+typedef memory_information *memory_infop;
 
 static memory_infop pinformation = NULL;
 static int current_allocation = 0;
@@ -2437,7 +2306,7 @@
 
     /* Unlink the element from the list. */
     {
-        memory_infop FAR *ppinfo = &pinformation;
+        memory_infop *ppinfo = &pinformation;
         for (;;) {
             memory_infop pinfo = *ppinfo;
             if (pinfo->pointer == ptr) {
@@ -3299,12 +3168,14 @@
             names++;
 
         /* GRR:  start of giant else-if block */
-        if (!strncmp(argv[i], "-already", 8))
+        if (!strncmp(argv[i], "-already", 8)) /* obsolete, now disabled */
         {
             names++;
             BUMP_I;
+#if 0 /* disabled */
             crushed_idat_size = (png_uint_32) pngcrush_get_long;
             pngcrush_check_long;
+#endif
         }
 
         else if (!strncmp(argv[i], "-bail", 5))
@@ -4109,6 +3980,8 @@
     /* Use of compression window size 256 is not recommended. */
     else if (default_compression_window == 256)
         default_compression_window = 8;
+    else if (default_compression_window == 0)
+        /* do nothing */;
     else if (default_compression_window != 15) {
         fprintf(STDERR, "Invalid window size (%d); using window size=4\n",
                 default_compression_window);
@@ -4334,7 +4207,9 @@
             }
             number_of_open_files++;
 
+#if 0 /* disabled */
             already_crushed = 0;
+#endif
 
 #ifdef PNGCRUSH_LOCO
             if (new_mng)
@@ -4390,7 +4265,7 @@
 
                 fprintf(STDERR, "   Recompressing IDAT chunks in %s\n", 
inname);
                 fprintf(STDERR,
-                  "   Total length of data found in critical chunks         "
+                  "   Total length of data found in critical chunks        "
                   "   =%10lu\n", (unsigned long)idat_length[0]);
                 fflush(STDERR);
             }
@@ -4403,10 +4278,12 @@
         else
             idat_length[0] = 1;
 
+#if 0 /* disabled */
         if (already_crushed)
         {
             fprintf(STDERR, "   File %s has already been crushed.\n", inname);
         }
+#endif
 
         if (image_is_immutable)
         {
@@ -4414,7 +4291,11 @@
               "   Image %s has a dSIG chunk and is immutable.\n", inname);
         }
 
+#if 0 /* disabled */
         if (!already_crushed && !image_is_immutable)
+#else
+        if (!image_is_immutable)
+#endif
         {
 
         if (do_color_count)
@@ -5127,6 +5008,7 @@
 #endif /* PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED */
             } /* last trial */
 
+/* TO DO: Remove this? We already did this in measure_idats */
             P1( "Reading signature bytes\n");
             {
 #ifdef PNGCRUSH_LOCO
@@ -5418,7 +5300,6 @@
  
                     if (trial > 0)
                     {
-#if 1
                     /* TO DO: have we got the right plte_len now? */
                       if (plte_len > 0 && output_color_type == 3 &&
                           force_output_bit_depth == 0)
@@ -5432,7 +5313,6 @@
                         else
                           force_output_bit_depth = 8;
                       }
-#endif /* 1 */
 
                     if (make_8_bit == 1)
                     {
@@ -6612,15 +6492,8 @@
                                                             max_possible_size);
                         }
 
-#ifdef WBITS_8_OK
-                        if (required_window <= 256)
-                            compression_window = 8;
-                        else if (required_window <= 512)
-                            compression_window = 9;
-#else
                         if (required_window <= 512)
                             compression_window = 9;
-#endif
                         else if (required_window <= 1024)
                             compression_window = 10;
                         else if (required_window <= 2048)
@@ -7324,7 +7197,11 @@
                   outname);
                 }
 
+#if 0 /* disabled */
                 else if (!already_crushed && !image_is_immutable)
+#else
+                else if (!image_is_immutable)
+#endif
                 {
                 fprintf(STDERR,
                   "   Best pngcrush method        = %3d "
@@ -7430,6 +7307,10 @@
 
 
 
+#define PNGCRUSH_a  97
+#define PNGCRUSH_z 122
+#define PNGCRUSH_A  65
+#define PNGCRUSH_Z  90 
 
 png_uint_32 pngcrush_measure_idat(png_structp png_ptr)
 {
@@ -7464,14 +7345,41 @@
             unsigned long length;
             /* read the MHDR */
             pngcrush_default_read_data(png_ptr, buff, 4);
+
             length = pngcrush_get_uint_31(png_ptr,buff);
             if (length > 28)
               png_error(png_ptr, "MHDR length too long");
 
             pngcrush_default_read_data(png_ptr, buff, 4);
-            if (verbose > 0)
-              printf("Reading %c%c%c%c chunk.\n",buff[0],buff[1],buff[2],
-                buff[3]);
+
+            /* TO DO: combine with checking for valid PNG chunk_name, below */
+            /* Check for valid chunk name [A-Za-z][A-Za-z][A-Z][A-Za-z] */
+            if (!(((buff[0] >= PNGCRUSH_a && buff[0] <= PNGCRUSH_z)  ||
+                   (buff[0] >= PNGCRUSH_A && buff[0] <= PNGCRUSH_Z)) &&
+                  ((buff[1] >= PNGCRUSH_a && buff[1] <= PNGCRUSH_z)  ||
+                   (buff[1] >= PNGCRUSH_A && buff[1] <= PNGCRUSH_Z)) &&
+                  ((buff[2] >= PNGCRUSH_A && buff[2] <= PNGCRUSH_Z)) &&
+                  ((buff[3] >= PNGCRUSH_a && buff[3] <= PNGCRUSH_z)  ||
+                   (buff[3] >= PNGCRUSH_A && buff[3] <= PNGCRUSH_Z))))
+            {
+               int i;
+               fprintf (STDERR,"Invalid MNG chunk name: \"");
+               for (i=0; i<4; i++)
+               {
+                 if ((buff[i] >= PNGCRUSH_a && buff[i] <= PNGCRUSH_z) ||
+                     (buff[i] >= PNGCRUSH_A && buff[i] <= PNGCRUSH_Z) ||
+                     (buff[i] >= '0' && buff[i] <= '9'))
+                    fprintf(STDERR,"%c",buff[i]);
+                 else
+                    fprintf(STDERR,"?");
+               }
+               fprintf(STDERR,"\" (0x%2x 0x%2x 0x%2x 0x%2x)\n",
+                  buff[0],buff[1],buff[2],buff[3]);
+            }
+            else
+               if (verbose > 0)
+                 printf("Reading %c%c%c%c chunk.\n",buff[0],buff[1],buff[2],
+                   buff[3]);
 
             pngcrush_default_read_data(png_ptr, buff, length);
 
@@ -7567,6 +7475,38 @@
         png_crc_read(png_ptr, chunk_name, 4);
         chunk_name[4]='\0';
 
+/* Check for valid chunk name [A-Za-z][A-Za-z][A-Z][A-Za-z] */
+        if (!(((chunk_name[0] >= PNGCRUSH_a && chunk_name[0] <= PNGCRUSH_z)  ||
+               (chunk_name[0] >= PNGCRUSH_A && chunk_name[0] <= PNGCRUSH_Z)) &&
+              ((chunk_name[1] >= PNGCRUSH_a && chunk_name[1] <= PNGCRUSH_z)  ||
+               (chunk_name[2] >= PNGCRUSH_A && chunk_name[2] <= PNGCRUSH_Z)) &&
+              ((chunk_name[2] >= PNGCRUSH_A && chunk_name[2] <= PNGCRUSH_Z)) &&
+              ((chunk_name[3] >= PNGCRUSH_a && chunk_name[3] <= PNGCRUSH_z)  ||
+               (chunk_name[3] >= PNGCRUSH_A && chunk_name[3] <= PNGCRUSH_Z))))
+        {
+           int i;
+
+           fprintf (STDERR,"Invalid chunk name: \"");
+               for (i=0; i<4; i++)
+               {
+                 if ((chunk_name[i] >= PNGCRUSH_a &&
+                      chunk_name[i] <= PNGCRUSH_z) ||
+                     (chunk_name[i] >= PNGCRUSH_A &&
+                      chunk_name[i] <= PNGCRUSH_Z)||
+                     (chunk_name[i] >= '0' &&
+                      chunk_name[i] <= '9'))
+                    fprintf(STDERR,"%c",chunk_name[i]);
+                 else
+                    fprintf(STDERR,"?");
+               }
+               fprintf(STDERR,"\" (0x%2x 0x%2x 0x%2x 0x%2x)\n",
+                  chunk_name[0],chunk_name[1],chunk_name[2],chunk_name[3]);
+        }
+        else
+           if (verbose > 0)
+              printf("Reading %c%c%c%c chunk.\n",
+                  chunk_name[0],chunk_name[1],chunk_name[2],chunk_name[3]);
+
         if (new_mng)
         {
           const png_byte png_DHDR[5] = {  68, 72, 68, 82, '\0' };
@@ -7687,8 +7627,10 @@
 #endif
             {
                 sum_idat_length += (length + 12);
+#if 0 /* disabled */
                 if (length > crushed_idat_size)
                     already_crushed++;
+#endif
             }
 
             if (verbose > 1)
@@ -8031,6 +7973,7 @@
 };
 
 struct options_help pngcrush_options[] = {
+#if 0
     {0, "      -already already_crushed_size [e.g., 8192]"},
     {2, ""},   /* blank */
     {2, "               If file has an IDAT greater than this size, it"},
@@ -8038,6 +7981,7 @@
     {2, "               not be processed, unless you are making other 
changes"},
     {2, "               or the \"-force\" option is present."},
     {2, ""},
+#endif
 
     {0, "         -bail (bail out of trial when size exceeds best size found"},
     {2, ""},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pngcrush-1.7.84/pngcrush.h 
new/pngcrush-1.7.85/pngcrush.h
--- old/pngcrush-1.7.84/pngcrush.h      2015-02-28 16:32:14.000000000 +0100
+++ new/pngcrush-1.7.85/pngcrush.h      2015-03-01 06:05:06.000000000 +0100
@@ -5,7 +5,7 @@
  * license (see LICENSE, in pngcrush.c).
  */
 
-/* Special defines for pngcrush version 1.7.84 */
+/* Special defines for pngcrush version 1.7.85 */
 
 #ifndef PNGCRUSH_H
 #define PNGCRUSH_H

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to