summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-06-15 10:10:52 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-06-15 10:11:50 -0500
commit0c734d0ec37015a5b1171b685e2f939e02839ec5 (patch)
tree2f9c91207b6a5cb36266f753d2b47b069e60a3fa
parenteabedfb4a9faacce7694d042a337582e297ab430 (diff)
downloadlibpng-1.7.30.tar.gz
Imported from pngcrush-1.7.30.tarv1.7.30
-rw-r--r--ChangeLog.html4
-rw-r--r--png.c16
-rw-r--r--png.h26
-rw-r--r--pngconf.h4
-rw-r--r--pngcrush.c14
-rw-r--r--pngerror.c2
-rw-r--r--pnglibconf.h2
-rw-r--r--pngpread.c5
-rw-r--r--pngpriv.h2
-rw-r--r--pngrtran.c13
-rw-r--r--pngset.c8
-rw-r--r--pngstruct.h5
-rw-r--r--pngtrans.c6
-rw-r--r--pngwrite.c5
14 files changed, 68 insertions, 44 deletions
diff --git a/ChangeLog.html b/ChangeLog.html
index ff5a689e6..4faa33706 100644
--- a/ChangeLog.html
+++ b/ChangeLog.html
@@ -3,6 +3,10 @@
Change log:
+Version 1.7.30 (built with libpng-1.5.11 and zlib-1.2.7)
+ Only run the new (in libpng-1.5.10) test of palette indexes during the
+ first trial.
+
Version 1.7.29 (built with libpng-1.5.10 and zlib-1.2.7)
Set "things_have_changed" flag when adding text chunks, so the "-force"
option is no longer necessary when adding text to an already-compressed
diff --git a/png.c b/png.c
index 539020c21..aecfd5ca2 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.5.10 [March 8, 2012]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_5_10 Your_png_h_is_not_version_1_5_10;
+typedef png_libpng_version_1_5_11 Your_png_h_is_not_version_1_5_11;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -655,14 +655,14 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.5.10 - March 29, 2012" PNG_STRING_NEWLINE \
- "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
+ "libpng version 1.5.11 - June 14, 2012" PNG_STRING_NEWLINE \
+ "Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
- return "libpng version 1.5.10 - March 29, 2012\
- Copyright (c) 1998-2011 Glenn Randers-Pehrson\
+ return "libpng version 1.5.11 - June 14, 2012\
+ Copyright (c) 1998-2012 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif
@@ -969,8 +969,8 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
* and it is certain that it becomes unstable where the end points are close
* together.
*
- * So this code uses the perhaps slighly less optimal but more understandable
- * and totally obvious approach of calculating color-scale.
+ * So this code uses the perhaps slightly less optimal but more
+ * understandable and totally obvious approach of calculating color-scale.
*
* This algorithm depends on the precision in white-scale and that is
* (1/white-y), so we can immediately see that as white-y approaches 0 the
diff --git a/png.h b/png.h
index 4e0dee179..b1c9e7243 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.5.10 - March 29, 2012
+ * libpng version 1.5.11 - June 14, 2012
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -11,7 +11,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.5.10 - March 29, 2012: Glenn
+ * libpng versions 0.97, January 1998, through 1.5.11 - June 14, 2012: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -174,6 +174,9 @@
* 1.5.9 15 10509 15.so.15.9[.0]
* 1.5.10beta01-05 15 10510 15.so.15.10[.0]
* 1.5.10 15 10510 15.so.15.10[.0]
+ * 1.5.11beta01 15 10511 15.so.15.11[.0]
+ * 1.5.11rc01-05 15 10511 15.so.15.11[.0]
+ * 1.5.11 15 10511 15.so.15.11[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -205,7 +208,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.5.10, March 29, 2012, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.5.11, June 14, 2012, are
* Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@@ -317,13 +320,13 @@
* Y2K compliance in libpng:
* =========================
*
- * March 29, 2012
+ * June 14, 2012
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
- * upward through 1.5.10 are Y2K compliant. It is my belief that
+ * upward through 1.5.11 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -334,7 +337,8 @@
* "png_uint_16 year" in png_time_struct.
*
* The string is
- * "png_char time_buffer" in png_struct
+ * "char time_buffer[29]" in png_struct. This will be no
+ * longer used in libpng-1.6.0 and will be removed from libpng-1.7.0.
*
* There are seven time-related functions:
* png.c: png_convert_to_rfc_1123() in png.c
@@ -381,9 +385,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.5.10"
+#define PNG_LIBPNG_VER_STRING "1.5.11"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.5.10 - March 29, 2012\n"
+ " libpng version 1.5.11 - June 14, 2012\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
@@ -391,7 +395,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 5
-#define PNG_LIBPNG_VER_RELEASE 10
+#define PNG_LIBPNG_VER_RELEASE 11
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -422,7 +426,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
-#define PNG_LIBPNG_VER 10510 /* 1.5.10 */
+#define PNG_LIBPNG_VER 10511 /* 1.5.11 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -544,7 +548,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_5_10;
+typedef char* png_libpng_version_1_5_11;
/* Three color definitions. The order of the red, green, and blue, (and the
* exact size) is not important, although the size of the fields need to
diff --git a/pngconf.h b/pngconf.h
index 5117d483c..e27d3ffa3 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.5.10 - March 29, 2012
+ * libpng version 1.5.11 - June 14, 2012
*
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -30,7 +30,7 @@
#ifndef PNG_BUILDING_SYMBOL_TABLE
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
* definition file for machine specific limits, this may impact the
- * correctness of the definitons below (see uses of INT_MAX).
+ * correctness of the definitions below (see uses of INT_MAX).
*/
# ifndef PNG_NO_LIMITS_H
# include <limits.h>
diff --git a/pngcrush.c b/pngcrush.c
index e8b03bcc6..9bd4135b5 100644
--- a/pngcrush.c
+++ b/pngcrush.c
@@ -59,7 +59,7 @@
*
*/
-#define PNGCRUSH_VERSION "1.7.29"
+#define PNGCRUSH_VERSION "1.7.30"
/* Experimental: define these if you wish, but, good luck.
#define PNGCRUSH_COUNT_COLORS
@@ -189,6 +189,10 @@
Change log:
+Version 1.7.30 (built with libpng-1.5.11 and zlib-1.2.7)
+ Only run the new (in libpng-1.5.10) test of palette indexes during the
+ first trial.
+
Version 1.7.29 (built with libpng-1.5.10 and zlib-1.2.7)
Set "things_have_changed" flag when adding text chunks, so the "-force"
option is no longer necessary when adding text to an already-compressed
@@ -3667,6 +3671,14 @@ int main(int argc, char *argv[])
PNG_CRC_QUIET_USE);
#endif
+#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
+ /* Only run this test (new in libpng-1.5.10) during the first trial */
+ png_set_check_for_invalid_index (read_ptr, first_trial);
+#endif
+#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
+ png_set_check_for_invalid_index (write_ptr, first_trial);
+#endif
+
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS,
(png_bytep) NULL, 0);
diff --git a/pngerror.c b/pngerror.c
index 95002f84f..e0585a856 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -2,7 +2,7 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Last changed in libpng 1.5.8 [February 1, 2011]
- * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
diff --git a/pnglibconf.h b/pnglibconf.h
index 6facf39aa..c8b185f29 100644
--- a/pnglibconf.h
+++ b/pnglibconf.h
@@ -3,7 +3,7 @@
/* pnglibconf.h - library build configuration */
-/* Libpng 1.5.10 - March 29, 2012 */
+/* Libpng 1.5.11 - June 14, 2012 */
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
diff --git a/pngpread.c b/pngpread.c
index 8a5aa29ec..6b65ba8f4 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.5.9 [February 18, 2012]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -282,8 +282,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
png_error(png_ptr, "Missing PLTE before IDAT");
}
}
-
#endif
+
else if (chunk_name == png_PLTE)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
@@ -550,6 +550,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
}
#endif
+
else
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
diff --git a/pngpriv.h b/pngpriv.h
index e76a57975..9b69f8c14 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -1259,10 +1259,8 @@ PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
-#endif
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
png_uint_32 chunk_name));
diff --git a/pngrtran.c b/pngrtran.c
index 556185286..96732b55c 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.5.10 [March 8, 2012]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1770,8 +1770,8 @@ png_init_read_transformations(png_structp png_ptr)
int num_palette = png_ptr->num_palette;
int i;
- /*NOTE: there are other transformations that should probably be in here
- * too.
+ /* NOTE: there are other transformations that should probably be in
+ * here too.
*/
for (i = 0; i < num_palette; i++)
{
@@ -2277,7 +2277,7 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
#endif
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
- /*NOTE: moved here in 1.5.4 (from much later in this list.) */
+ /* NOTE: moved here in 1.5.4 (from much later in this list.) */
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
@@ -2301,7 +2301,8 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Added at libpng-1.5.10 */
- if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
+ if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
+ png_ptr->num_palette_max >= 0)
png_do_check_palette_indexes(png_ptr, row_info);
#endif
@@ -3302,7 +3303,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
if (red != green || red != blue)
{
rgb_error |= 1;
- /*NOTE: this is the historical approach which simply
+ /* NOTE: this is the historical approach which simply
* truncates the results.
*/
*(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
diff --git a/pngset.c b/pngset.c
index d35975e5c..8c07eec3e 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.5.10 [(PENDING RELEASE)]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1291,8 +1291,10 @@ png_set_benign_errors(png_structp png_ptr, int allowed)
}
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
-#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
- /* Do not report invalid palette index; added at libng-1.5.10 */
+#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+/* Whether to report invalid palette index; added at libng-1.5.10
+ * allowed - one of 0: disable; 1: enable
+ */
void PNGAPI
png_set_check_for_invalid_index(png_structp png_ptr, int allowed)
{
diff --git a/pngstruct.h b/pngstruct.h
index 43a45cdec..db0d4e494 100644
--- a/pngstruct.h
+++ b/pngstruct.h
@@ -1,11 +1,11 @@
/* pngstruct.h - header file for PNG reference library
*
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
- * Last changed in libpng 1.5.9 [March 29, 2012]
+ * Last changed in libpng 1.5.9 [February 18, 2012]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -248,6 +248,7 @@ struct png_struct_def
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
+ /* This is going to be unused in libpng16 and removed from libpng17 */
char time_buffer[29]; /* String to hold RFC 1123 time text */
#endif
diff --git a/pngtrans.c b/pngtrans.c
index fef12f185..ee60957fc 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.5.10 [March 8, 2012]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -626,7 +626,7 @@ void /* PRIVATE */
png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
{
if (png_ptr->num_palette < (1 << row_info->bit_depth) &&
- png_ptr->num_palette_max >= 0)
+ png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */
{
/* Calculations moved outside switch in an attempt to stop different
* compiler warnings. 'padding' is in *bits* within the last byte, it is
@@ -708,7 +708,7 @@ png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
{
for (; rp > png_ptr->row_buf; rp--)
{
- if (*rp >= png_ptr->num_palette_max)
+ if (*rp > png_ptr->num_palette_max)
png_ptr->num_palette_max = (int) *rp;
}
diff --git a/pngwrite.c b/pngwrite.c
index b587f1b99..2a72ad33f 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.5.10 [March 8, 2012]
+ * Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -806,7 +806,8 @@ png_write_row(png_structp png_ptr, png_const_bytep row)
/* Added at libpng-1.5.10 */
#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Check for out-of-range palette index */
- if(row_info.color_type == PNG_COLOR_TYPE_PALETTE)
+ if (row_info.color_type == PNG_COLOR_TYPE_PALETTE &&
+ png_ptr->num_palette_max >= 0)
png_do_check_palette_indexes(png_ptr, &row_info);
#endif