summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp@shaggy.simplesystems.org>2010-01-03 08:40:25 -0600
committerGlenn Randers-Pehrson <glennrp@shaggy.simplesystems.org>2010-01-03 08:40:25 -0600
commit80d407d3c42363012533d6c018aac78ac28440f3 (patch)
tree830bb67da6f78ab63ad3404e4e1d837a8c7cd0e7
parentd1518e490fbdf08d39fd8928cb59d1c0777f1a3b (diff)
downloadlibpng-80d407d3c42363012533d6c018aac78ac28440f3.tar.gz
Updated bundled libpng to version 1.4.0v1.7.7
-rw-r--r--ChangeLog.html6
-rw-r--r--Makefile3
-rw-r--r--png.c19
-rw-r--r--png.h24
-rw-r--r--pngconf.h4
-rw-r--r--pngcrush.c5
-rw-r--r--pngerror.c13
-rw-r--r--pngget.c4
-rw-r--r--pngmem.c4
-rw-r--r--pngpread.c8
-rw-r--r--pngpriv.h4
-rw-r--r--pngread.c4
-rw-r--r--pngrio.c4
-rw-r--r--pngrtran.c9
-rw-r--r--pngrutil.c11
-rw-r--r--pngset.c44
-rw-r--r--pngtest.c24
-rw-r--r--pngtrans.c4
-rw-r--r--pngwio.c4
-rw-r--r--pngwrite.c4
-rw-r--r--pngwtran.c4
-rw-r--r--pngwutil.c4
22 files changed, 115 insertions, 95 deletions
diff --git a/ChangeLog.html b/ChangeLog.html
index 8b719010e..62cc393ab 100644
--- a/ChangeLog.html
+++ b/ChangeLog.html
@@ -3,6 +3,12 @@
Change log:
+Version 1.7.7 (built with libpng-1.4.0 and zlib-1.2.3.4)
+ Updated bundled libpng to version 1.4.0.
+ Check the "-plte_len n" option for out-of-range value of n.
+ Changed local variable "write" to "z_write" in inffast.c (zlib-1.2.3.4)
+ to avoid shadowed declaration warning.
+
Version 1.7.6 (built with libpng-1.4.0rc02 and zlib-1.2.3.2)
Change some "#if defined(X)" to "#ifdef X" according to libpng coding style.
Added some defines to suppress pedantic warnings from libpng-1.2.41beta15
diff --git a/Makefile b/Makefile
index 5a3163125..c10a4e7fc 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ RM = rm -f
#CFLAGS = -I. -O -Wall
#CFLAGS = -I. -O2 -fomit-frame-pointer -Wall
#CFLAGS = -I. -O3 -fomit-frame-pointer -Wall
+#CFLAGS = -I. -Os -fomit-frame-pointer -Wall
CFLAGS = -I. -O3 -funroll-loops -fomit-frame-pointer -Wall -Wshadow
#CFLAGS = -I${ZINC} -I. -O3 -fomit-frame-pointer -Wall
# [note that -Wall is a gcc-specific compilation flag ("all warnings on")]
@@ -51,7 +52,7 @@ EXES = $(PNGCRUSH)$(E)
# implicit make rules -------------------------------------------------------
-.c$(O): png.h pngconf.h pngcrush.h cexcept.h $(ZHDR)
+.c$(O): png.h pngconf.h pngcrush.h cexcept.h pngpriv.h $(ZHDR)
$(CC) -c $(CFLAGS) $<
diff --git a/png.c b/png.c
index a782d400f..a845a4783 100644
--- a/png.c
+++ b/png.c
@@ -1,8 +1,8 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -17,7 +17,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_4_0rc04 Your_png_h_is_not_version_1_4_0rc04;
+typedef version_1_4_0 Your_png_h_is_not_version_1_4_0;
/* Version information for C files. This had better match the version
* string defined in png.h.
@@ -315,7 +315,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
{
png_free(png_ptr, info_ptr->pcal_params[i]);
- info_ptr->pcal_params[i]=NULL;
+ info_ptr->pcal_params[i] = NULL;
}
png_free(png_ptr, info_ptr->pcal_params);
info_ptr->pcal_params = NULL;
@@ -430,8 +430,10 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
for (row = 0; row < (int)info_ptr->height; row++)
{
png_free(png_ptr, info_ptr->row_pointers[row]);
+ info_ptr->row_pointers[row] = NULL;
}
png_free(png_ptr, info_ptr->row_pointers);
+ info_ptr->row_pointers = NULL;
}
info_ptr->valid &= ~PNG_INFO_IDAT;
}
@@ -458,6 +460,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
if (png_ptr->num_chunk_list)
{
png_free(png_ptr, png_ptr->chunk_list);
+ png_ptr->chunk_list = NULL;
png_ptr->num_chunk_list = 0;
}
#endif
@@ -548,14 +551,14 @@ png_get_copyright(png_structp png_ptr)
#else
#ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \
- "libpng version 1.4.0rc04 - December 25, 2009" PNG_STRING_NEWLINE \
- "Copyright (c) 1998-2009 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
+ "libpng version 1.4.0 - January 3, 2010" PNG_STRING_NEWLINE \
+ "Copyright (c) 1998-2010 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 ((png_charp) "libpng version 1.4.0rc04 - December 25, 2009\
- Copyright (c) 1998-2009 Glenn Randers-Pehrson\
+ return ((png_charp) "libpng version 1.4.0 - January 3, 2010\
+ Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
#endif
diff --git a/png.h b/png.h
index fc65c8731..14e34165c 100644
--- a/png.h
+++ b/png.h
@@ -1,8 +1,8 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.4.0rc04 - December 25, 2009
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * libpng version 1.4.0 - January 3, 2010
+ * Copyright (c) 1998-2010 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.4.0rc04 - December 25, 2009: Glenn
+ * libpng versions 0.97, January 1998, through 1.4.0 - January 3, 2010: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -132,7 +132,7 @@
* 1.4.0beta37-87 14 10400 14.so.14.0[.0]
* 1.4.0rc01 14 10400 14.so.14.0[.0]
* 1.4.0beta88-109 14 10400 14.so.14.0[.0]
- * 1.4.0rc02-04 14 10400 14.so.14.0[.0]
+ * 1.4.0rc02-08 14 10400 14.so.14.0[.0]
* 1.4.0 14 10400 14.so.14.0[.0]
*
* Henceforth the source version will match the shared-library major
@@ -165,8 +165,8 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.4.0rc04, December 25, 2009, are
- * Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
+ * libpng versions 1.2.6, August 15, 2004, through 1.4.0, January 3, 2010, are
+ * Copyright (c) 2004, 2006-2010 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:
*
@@ -277,13 +277,13 @@
* Y2K compliance in libpng:
* =========================
*
- * July 1, 2008
+ * January 3, 2010
*
* 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.4.0rc04 are Y2K compliant. It is my belief that earlier
+ * upward through 1.4.0 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -339,9 +339,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.4.0rc04"
+#define PNG_LIBPNG_VER_STRING "1.4.0"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.4.0rc04 - December 25, 2009\n"
+ " libpng version 1.4.0 - January 3, 2010\n"
#define PNG_LIBPNG_VER_SONUM 14
#define PNG_LIBPNG_VER_DLLNUM 14
@@ -354,7 +354,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
-#define PNG_LIBPNG_VER_BUILD 04
+#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
@@ -1343,7 +1343,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef png_structp version_1_4_0rc04;
+typedef png_structp version_1_4_0;
typedef png_struct FAR * FAR * png_structpp;
diff --git a/pngconf.h b/pngconf.h
index f1863dcb9..93ed01a46 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.4.0rc04 - December 25, 2009
+ * libpng version 1.4.0 - January 3, 2010
* For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2010 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/pngcrush.c b/pngcrush.c
index fce2ec64f..b512be6b1 100644
--- a/pngcrush.c
+++ b/pngcrush.c
@@ -160,8 +160,9 @@
Change log:
-Version 1.7.7 (built with libpng-1.4.0rc04 and zlib-1.2.3.4)
- Check "-plte_len n" option for out-of-range value of n.
+Version 1.7.7 (built with libpng-1.4.0 and zlib-1.2.3.4)
+ Updated bundled libpng to version 1.4.0.
+ Check the "-plte_len n" option for out-of-range value of n.
Changed local variable "write" to "z_write" in inffast.c (zlib-1.2.3.4)
to avoid shadowed declaration warning.
diff --git a/pngerror.c b/pngerror.c
index 9820e7a05..633eae29f 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -231,11 +231,12 @@ png_chunk_benign_error(png_structp png_ptr, png_const_charp error_message)
#endif /* PNG_READ_SUPPORTED */
#ifdef PNG_SETJMP_SUPPORTED
-/* This API only exists if ANSI-C style error handling is used, otherwise
- * it is necessary for png_default_error to be overridden.
+/* This API only exists if ANSI-C style error handling is used,
+ * otherwise it is necessary for png_default_error to be overridden.
*/
jmp_buf* PNGAPI
-png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)
+png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn,
+ size_t jmp_buf_size)
{
if (png_ptr == NULL || jmp_buf_size != png_sizeof(jmp_buf))
return NULL;
@@ -295,7 +296,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
{
jmp_buf jmpbuf;
png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf));
- png_ptr->longjmp_fn(jmpbuf, 1);
+ png_ptr->longjmp_fn(jmpbuf, 1);
}
# else
png_ptr->longjmp_fn(png_ptr->jmpbuf, 1);
diff --git a/pngget.c b/pngget.c
index 62fa4146a..8611b8585 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,8 +1,8 @@
/* pngget.c - retrieval of values from info struct
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngmem.c b/pngmem.c
index dfea52080..dee296656 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -1,8 +1,8 @@
/* pngmem.c - stub functions for memory allocation
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngpread.c b/pngpread.c
index 1c8628de9..e3d311107 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,8 +1,8 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -1565,7 +1565,7 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
png_free(png_ptr, text_ptr);
if (ret)
- png_warning(png_ptr, "Insufficient memory to store iTXt chunk");
+ png_warning(png_ptr, "Insufficient memory to store iTXt chunk");
}
}
#endif
@@ -1620,7 +1620,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
else
{
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr,
- (png_size_t)length);
+ (png_size_t)length);
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
}
diff --git a/pngpriv.h b/pngpriv.h
index e3d442e76..13c2b3fce 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -1,9 +1,9 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * libpng version 1.4.0rc04 - December 25, 2009
+ * libpng version 1.4.0 - January 3, 2010
* For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2010 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/pngread.c b/pngread.c
index f2afb19ce..1b3a3f575 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,8 +1,8 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngrio.c b/pngrio.c
index 9fbed1ad7..53f2a4527 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,8 +1,8 @@
/* pngrio.c - functions for data input
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngrtran.c b/pngrtran.c
index bd1cc96ef..30aa5dc38 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -886,10 +886,7 @@ png_init_read_transformations(png_structp png_ptr)
if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) &&
png_ptr->gamma != 0.0)
{
- if (png_ptr->transformations & PNG_16_TO_8)
- png_build_gamma_table(png_ptr, 8);
- else
- png_build_gamma_table(png_ptr, png_ptr->bit_depth);
+ png_build_gamma_table(png_ptr, png_ptr->bit_depth);
#ifdef PNG_READ_BACKGROUND_SUPPORTED
if (png_ptr->transformations & PNG_BACKGROUND)
diff --git a/pngrutil.c b/pngrutil.c
index 4f625486a..d971e8f18 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -3285,9 +3285,12 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
if (row_bytes + 48 > png_ptr->old_big_row_buf_size)
{
png_free(png_ptr, png_ptr->big_row_buf);
- png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48);
if (png_ptr->interlaced)
- png_memset(png_ptr->big_row_buf, 0, row_bytes + 48);
+ png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr,
+ row_bytes + 48);
+ else
+ png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr,
+ row_bytes + 48);
png_ptr->old_big_row_buf_size = row_bytes + 48;
#ifdef PNG_ALIGNED_MEMORY_SUPPORTED
diff --git a/pngset.c b/pngset.c
index b9981f057..adb401604 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -389,7 +389,7 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
if (info_ptr->scal_s_width == NULL)
{
png_warning(png_ptr,
- "Memory allocation failed while processing sCAL");
+ "Memory allocation failed while processing sCAL");
return;
}
png_memcpy(info_ptr->scal_s_width, swidth, length);
@@ -403,7 +403,7 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
png_free (png_ptr, info_ptr->scal_s_width);
info_ptr->scal_s_width = NULL;
png_warning(png_ptr,
- "Memory allocation failed while processing sCAL");
+ "Memory allocation failed while processing sCAL");
return;
}
png_memcpy(info_ptr->scal_s_height, sheight, length);
@@ -452,8 +452,7 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
}
}
- /*
- * It may not actually be necessary to set png_ptr->palette here;
+ /* It may not actually be necessary to set png_ptr->palette here;
* we do it for backward compatibility with the way the png_handle_tRNS
* function used to do the allocation.
*/
@@ -593,7 +592,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
if (new_iccp_name == NULL)
{
- png_warning(png_ptr, "Insufficient memory to process iCCP chunk");
+ png_warning(png_ptr, "Insufficient memory to process iCCP chunk");
return;
}
png_memcpy(new_iccp_name, name, length);
@@ -602,7 +601,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
{
png_free (png_ptr, new_iccp_name);
png_warning(png_ptr,
- "Insufficient memory to process iCCP profile");
+ "Insufficient memory to process iCCP profile");
return;
}
png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
@@ -613,7 +612,8 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
info_ptr->iccp_name = new_iccp_name;
info_ptr->iccp_profile = new_iccp_profile;
/* Compression is always zero but is here so the API and info structure
- * does not have to change if we introduce multiple compression types */
+ * does not have to change if we introduce multiple compression types
+ */
info_ptr->iccp_compression = (png_byte)compression_type;
info_ptr->free_me |= PNG_FREE_ICCP;
info_ptr->valid |= PNG_INFO_iCCP;
@@ -886,11 +886,11 @@ png_set_sPLT(png_structp png_ptr,
if (np == NULL)
{
png_warning(png_ptr, "No memory for sPLT palettes");
- return;
+ return;
}
png_memcpy(np, info_ptr->splt_palettes,
- info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
+ info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes=NULL;
@@ -901,7 +901,7 @@ png_set_sPLT(png_structp png_ptr,
png_uint_32 length;
length = png_strlen(from->name) + 1;
- to->name = (png_charp)png_malloc_warn(png_ptr, (png_size_t)length);
+ to->name = (png_charp)png_malloc_warn(png_ptr, (png_size_t)length);
if (to->name == NULL)
{
png_warning(png_ptr,
@@ -910,7 +910,7 @@ png_set_sPLT(png_structp png_ptr,
}
png_memcpy(to->name, from->name, length);
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
- (png_size_t)(from->nentries * png_sizeof(png_sPLT_entry)));
+ (png_size_t)(from->nentries * png_sizeof(png_sPLT_entry)));
if (to->entries == NULL)
{
png_warning(png_ptr,
@@ -949,22 +949,22 @@ png_set_unknown_chunks(png_structp png_ptr,
if (np == NULL)
{
png_warning(png_ptr,
- "Out of memory while processing unknown chunk");
+ "Out of memory while processing unknown chunk");
return;
}
png_memcpy(np, info_ptr->unknown_chunks,
- info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
+ info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
png_free(png_ptr, info_ptr->unknown_chunks);
+ info_ptr->unknown_chunks = NULL;
for (i = 0; i < num_unknowns; i++)
{
png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
png_unknown_chunkp from = unknowns + i;
- png_memcpy((png_charp)to->name,
- (png_charp)from->name,
- png_sizeof(from->name));
+ png_memcpy((png_charp)to->name, (png_charp)from->name,
+ png_sizeof(from->name));
to->name[png_sizeof(to->name)-1] = '\0';
to->size = from->size;
/* Note our location in the read or write sequence */
@@ -996,7 +996,7 @@ png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
int chunk, int location)
{
if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk <
- (int)info_ptr->unknown_chunks_num)
+ (int)info_ptr->unknown_chunks_num)
info_ptr->unknown_chunks[chunk].location = (png_byte)location;
}
#endif
@@ -1043,16 +1043,16 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
old_num_chunks = png_ptr->num_chunk_list;
new_list=(png_bytep)png_malloc(png_ptr,
(png_size_t)
- (5*(num_chunks + old_num_chunks)));
+ (5*(num_chunks + old_num_chunks)));
if (png_ptr->chunk_list != NULL)
{
png_memcpy(new_list, png_ptr->chunk_list,
- (png_size_t)(5*old_num_chunks));
+ (png_size_t)(5*old_num_chunks));
png_free(png_ptr, png_ptr->chunk_list);
png_ptr->chunk_list=NULL;
}
png_memcpy(new_list + 5*old_num_chunks, chunk_list,
- (png_size_t)(5*num_chunks));
+ (png_size_t)(5*num_chunks));
for (p = new_list + 5*old_num_chunks + 4, i = 0; i<num_chunks; i++, p += 5)
*p=(png_byte)keep;
png_ptr->num_chunk_list = old_num_chunks + num_chunks;
diff --git a/pngtest.c b/pngtest.c
index 8d19f3dac..4b70404c4 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,8 +1,8 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -267,12 +267,17 @@ static int wrote_question = 0;
static void
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
- png_size_t check;
+ png_size_t check = 0;
+ png_voidp io_ptr;
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
* instead of an int, which is what fread() actually returns.
*/
- check = fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
+ io_ptr = png_get_io_ptr(png_ptr);
+ if (io_ptr != NULL)
+ {
+ check = fread(data, 1, length, (png_FILE_p)io_ptr);
+ }
if (check != length)
{
@@ -412,9 +417,12 @@ static void
pngtest_warning(png_structp png_ptr, png_const_charp message)
{
PNG_CONST char *name = "UNKNOWN (ERROR!)";
- if (png_ptr != NULL && png_ptr->error_ptr != NULL)
- name = png_ptr->error_ptr;
- fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
+ char *test;
+ test = png_get_error_ptr(png_ptr);
+ if (test == NULL)
+ fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
+ else
+ fprintf(STDERR, "%s: libpng warning: %s\n", test, message);
}
/* This is the default error handling function. Note that replacements for
@@ -1619,4 +1627,4 @@ main(int argc, char *argv[])
}
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_4_0rc04 your_png_h_is_not_version_1_4_0rc04;
+typedef version_1_4_0 your_png_h_is_not_version_1_4_0;
diff --git a/pngtrans.c b/pngtrans.c
index 8cc76ac2a..7b217bb3b 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,8 +1,8 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngwio.c b/pngwio.c
index bb01443ae..f4d995b18 100644
--- a/pngwio.c
+++ b/pngwio.c
@@ -1,8 +1,8 @@
/* pngwio.c - functions for data output
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngwrite.c b/pngwrite.c
index 8c7c958f7..01a7f60e5 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngwtran.c b/pngwtran.c
index 2f79c64a1..9c8a6e7a9 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -1,8 +1,8 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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/pngwutil.c b/pngwutil.c
index 19960601d..eddac5b33 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,8 +1,8 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Last changed in libpng 1.4.0 [December 25, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.0 [January 3, 2010]
+ * Copyright (c) 1998-2010 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.)
*