[legacy] Imported from libpng-1.2.44beta01.tar

This commit is contained in:
Glenn Randers-Pehrson
2010-06-18 18:49:53 -05:00
parent e193ade706
commit b52da4038d
58 changed files with 179 additions and 150 deletions

View File

@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
* Last changed in libpng 1.2.43 [February 25, 2010]
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* Last changed in libpng 1.2.44 [June 18, 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.)
*
@@ -341,8 +341,10 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
if (png_ptr->user_chunk_malloc_max &&
(prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1))
#else
# ifdef PNG_USER_CHUNK_MALLOC_MAX
if ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
# endif
#endif
png_warning(png_ptr, "Exceeded size limit while expanding chunk");
@@ -351,7 +353,11 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
* and we have nothing to do - the code will exit through the
* error case below.
*/
else if (expanded_size > 0)
#if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \
defined(PNG_USER_CHUNK_MALLOC_MAX)
else
#endif
if (expanded_size > 0)
{
/* Success (maybe) - really uncompress the chunk. */
png_size_t new_size = 0;