diff options
Diffstat (limited to 'plugins/AdvaImg/src/LibPNG/pngrutil.c')
-rw-r--r-- | plugins/AdvaImg/src/LibPNG/pngrutil.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/AdvaImg/src/LibPNG/pngrutil.c b/plugins/AdvaImg/src/LibPNG/pngrutil.c index 995896dbc5..b9c3905c79 100644 --- a/plugins/AdvaImg/src/LibPNG/pngrutil.c +++ b/plugins/AdvaImg/src/LibPNG/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.5.9 [February 18, 2012]
+ * Last changed in libpng 1.5.10 [March 8, 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.)
@@ -434,14 +434,12 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, */
if (prefix_size >= (~(png_size_t)0) - 1 ||
expanded_size >= (~(png_size_t)0) - 1 - prefix_size
-#ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
+#ifdef PNG_USER_LIMITS_SUPPORTED
|| (png_ptr->user_chunk_malloc_max &&
(prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1))
#else
-# ifdef PNG_USER_CHUNK_MALLOC_MAX
|| ((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");
@@ -1259,13 +1257,16 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) /* Should be an error, but we can cope with it */
png_warning(png_ptr, "Out of place iCCP chunk");
- if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP))
+ if ((png_ptr->mode & PNG_HAVE_iCCP) || (info_ptr != NULL &&
+ (info_ptr->valid & (PNG_INFO_iCCP|PNG_INFO_sRGB))))
{
png_warning(png_ptr, "Duplicate iCCP chunk");
png_crc_finish(png_ptr, length);
return;
}
+ png_ptr->mode |= PNG_HAVE_iCCP;
+
#ifdef PNG_MAX_MALLOC_64K
if (length > (png_uint_32)65535L)
{
@@ -1795,16 +1796,16 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return;
}
- num = length / 2 ;
-
- if (num != (unsigned int)png_ptr->num_palette || num >
- (unsigned int)PNG_MAX_PALETTE_LENGTH)
+ if (length > 2*PNG_MAX_PALETTE_LENGTH ||
+ length != (unsigned int) (2*png_ptr->num_palette))
{
png_warning(png_ptr, "Incorrect hIST chunk length");
png_crc_finish(png_ptr, length);
return;
}
+ num = length / 2 ;
+
for (i = 0; i < num; i++)
{
png_byte buf[2];
@@ -3115,7 +3116,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display) /* This can only be the RGB case, so each copy is exactly one
* pixel and it is not necessary to check for a partial copy.
*/
- for (;;)
+ for(;;)
{
dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
@@ -3705,7 +3706,7 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp) {
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
- pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
+ pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
|