[master] Added defineable PNG_USER_CHUNK_CACHE_MAX and PNG_USER_CHUNK_MALLOC_MAX

This commit is contained in:
Glenn Randers-Pehrson
2010-02-05 15:32:42 -06:00
parent c05538959b
commit deb870c77d
4 changed files with 49 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.4.1beta06 - February 2, 2010 Libpng 1.4.1beta07 - February 5, 2010
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@@ -9,20 +9,20 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
1.4.1beta06.tar.xz (LZMA-compressed, recommended) 1.4.1beta07.tar.xz (LZMA-compressed, recommended)
1.4.1beta06.tar.gz 1.4.1beta07.tar.gz
1.4.1beta06.tar.bz2 1.4.1beta07.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp141b06.zip lp141b07.zip
lp141b06.7z lp141b07.7z
Other information: Other information:
1.4.1beta06-README.txt 1.4.1beta07-README.txt
1.4.1beta06-LICENSE.txt 1.4.1beta07-LICENSE.txt
Changes since the last public release (1.4.0): Changes since the last public release (1.4.0):
@@ -55,10 +55,13 @@ version 1.4.1beta04 [January 23, 2010]
version 1.4.1beta05 [January 26, 2010] version 1.4.1beta05 [January 26, 2010]
Relocated "int k" declaration in pngtest.c to minimize its scope. Relocated "int k" declaration in pngtest.c to minimize its scope.
version 1.4.1beta06 [February 2, 2010] version 1.4.1beta06 [January 28, 2010]
Revised png_decompress_chunk() to use a two-pass method suggested by Revised png_decompress_chunk() to use a two-pass method suggested by
John Bowler. John Bowler.
version 1.4.1beta07 [February 5, 2010]
Added defineable PNG_USER_CHUNK_CACHE_MAX and PNG_USER_CHUNK_MALLOC_MAX
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@@ -2487,10 +2487,13 @@ version 1.4.1beta04 [January 23, 2010]
version 1.4.1beta05 [January 26, 2010] version 1.4.1beta05 [January 26, 2010]
Relocated "int k" declaration in pngtest.c to minimize its scope. Relocated "int k" declaration in pngtest.c to minimize its scope.
version 1.4.1beta06 [February 2, 2010] version 1.4.1beta06 [January 28, 2010]
Revised png_decompress_chunk() to use a two-pass method suggested by Revised png_decompress_chunk() to use a two-pass method suggested by
John Bowler. John Bowler.
version 1.4.1beta07 [February 5, 2010]
Added defineable PNG_USER_CHUNK_CACHE_MAX and PNG_USER_CHUNK_MALLOC_MAX
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.4.1beta06 - January 28, 2010 * libpng version 1.4.1beta07 - February 5, 2010
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -676,12 +676,14 @@
# ifndef PNG_NO_SET_USER_LIMITS # ifndef PNG_NO_SET_USER_LIMITS
# define PNG_SET_USER_LIMITS_SUPPORTED # define PNG_SET_USER_LIMITS_SUPPORTED
/* Feature added at libpng-1.4.0, this flag added at 1.4.1 */ /* Feature added at libpng-1.4.0, this flag added at 1.4.1 */
# define PNG_CHUNK_CACHE_LIMIT_SUPPORTED # define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
/* Feature added at libpng-1.4.1, this flag added at 1.4.1 */ /* Feature added at libpng-1.4.1, this flag added at 1.4.1 */
# define PNG_CHUNK_MALLOC_LIMIT_SUPPORTED # define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
# endif # endif
#endif #endif
/* Added at libpng-1.2.43 */
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter
* how large, set these limits to 0x7fffffffL * how large, set these limits to 0x7fffffffL
*/ */
@@ -692,11 +694,16 @@
# define PNG_USER_HEIGHT_MAX 1000000L # define PNG_USER_HEIGHT_MAX 1000000L
#endif #endif
/* Added at libpng-1.4.0 */ /* Added at libpng-1.2.43 */
#ifndef PNG_USER_CHUNK_CACHE_MAX #ifndef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 0x7fffffffL # define PNG_USER_CHUNK_CACHE_MAX 0x7fffffffL
#endif #endif
/* Added at libpng-1.2.43 */
#ifndef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 0x7fffffffL
#endif
/* Added at libpng-1.4.0 */ /* Added at libpng-1.4.0 */
#if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED) #if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED)
# define PNG_IO_STATE_SUPPORTED # define PNG_IO_STATE_SUPPORTED
@@ -865,20 +872,22 @@
#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
#ifndef PNG_NO_READ_UNKNOWN_CHUNKS #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
# ifndef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
# endif
# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
# define PNG_UNKNOWN_CHUNKS_SUPPORTED # define PNG_UNKNOWN_CHUNKS_SUPPORTED
# endif # endif
#endif # ifndef PNG_READ_USER_CHUNKS_SUPPORTED
#if !defined(PNG_NO_READ_USER_CHUNKS) && \
defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
# define PNG_READ_USER_CHUNKS_SUPPORTED # define PNG_READ_USER_CHUNKS_SUPPORTED
# define PNG_USER_CHUNKS_SUPPORTED
# ifdef PNG_NO_READ_UNKNOWN_CHUNKS
# undef PNG_NO_READ_UNKNOWN_CHUNKS
# endif # endif
# ifdef PNG_NO_HANDLE_AS_UNKNOWN #endif
# undef PNG_NO_HANDLE_AS_UNKNOWN #ifndef PNG_NO_READ_USER_CHUNKS
# ifndef PNG_READ_USER_CHUNKS_SUPPORTED
# define PNG_READ_USER_CHUNKS_SUPPORTED
# endif
# ifndef PNG_USER_CHUNKS_SUPPORTED
# define PNG_USER_CHUNKS_SUPPORTED
# endif # endif
#endif #endif
#ifndef PNG_NO_HANDLE_AS_UNKNOWN #ifndef PNG_NO_HANDLE_AS_UNKNOWN
@@ -1020,9 +1029,11 @@
#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
#if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) #ifndef PNG_NO_WRITE_FILTER
# ifndef PNG_WRITE_FILTER_SUPPORTED
# define PNG_WRITE_FILTER_SUPPORTED # define PNG_WRITE_FILTER_SUPPORTED
# endif # endif
#endif
#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED

View File

@@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct /* pngget.c - retrieval of values from info struct
* *
* Last changed in libpng 1.4.1 [January 28, 2010] * Last changed in libpng 1.4.1 [February 5, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -880,7 +880,8 @@ png_get_compression_buffer_size(png_structp png_ptr)
#ifdef PNG_SET_USER_LIMITS_SUPPORTED #ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* These functions were added to libpng 1.2.6 */ /* These functions were added to libpng 1.2.6 and were enabled
* by default in libpng-1.4.0 */
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_user_width_max (png_structp png_ptr) png_get_user_width_max (png_structp png_ptr)
{ {
@@ -895,18 +896,17 @@ png_get_user_height_max (png_structp png_ptr)
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_chunk_cache_max (png_structp png_ptr) png_get_chunk_cache_max (png_structp png_ptr)
{ {
return (png_ptr? (png_ptr->user_chunk_cache_max? return (png_ptr? png_ptr->user_chunk_cache_max : 0);
png_ptr->user_chunk_cache_max - 1 : 0x7fffffffL) : 0);
} }
/* This function was added to libpng 1.4.1 */ /* This function was added to libpng 1.4.1 */
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_chunk_malloc_max (png_structp png_ptr) png_get_chunk_malloc_max (png_structp png_ptr)
{ {
return (png_ptr? (png_ptr->user_chunk_malloc_max? return (png_ptr? png_ptr->user_chunk_malloc_max : 0);
png_ptr->user_chunk_malloc_max : 0x7fffffffL) : 0);
} }
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
/* These functions were added to libpng 1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED #ifdef PNG_IO_STATE_SUPPORTED
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_io_state (png_structp png_ptr) png_get_io_state (png_structp png_ptr)