From 0d95b3d8dc70d293fea79f79160c0d4581e94699 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 19 Feb 2012 22:58:50 -0600 Subject: [PATCH] [libpng14] Removed two useless #ifdef directives from pngread.c and one from pngrutil.c --- ANNOUNCE | 1 + CHANGES | 1 + pngread.c | 12 +++++------- pngrutil.c | 6 ++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index ccac99f99..7bea2cd51 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -27,6 +27,7 @@ Other information: Changes since the last public release (1.4.8): version 1.4.10beta01 [February 20, 2012] + Removed two useless #ifdef directives from pngread.c and one from pngrutil.c Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 2b7177fbf..1c863b261 100644 --- a/CHANGES +++ b/CHANGES @@ -2840,6 +2840,7 @@ version 1.4.9 [February 18, 2012] No changes. version 1.4.10beta01 [February 20, 2012] + Removed two useless #ifdef directives from pngread.c and one from pngrutil.c Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngread.c b/pngread.c index 7d6b76a9d..1f832a71b 100644 --- a/pngread.c +++ b/pngread.c @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.6 [March 8, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.4.10 [February 20, 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.) * @@ -70,14 +70,12 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, #ifdef PNG_USER_LIMITS_SUPPORTED png_ptr->user_width_max = PNG_USER_WIDTH_MAX; png_ptr->user_height_max = PNG_USER_HEIGHT_MAX; -# ifdef PNG_USER_CHUNK_CACHE_MAX + /* Added at libpng-1.2.43 and 1.4.0 */ png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; -# endif -# ifdef PNG_SET_USER_CHUNK_MALLOC_MAX - /* Added at libpng-1.2.43 and 1.4.1 */ + + /* Added at libpng-1.4.1 */ png_ptr->user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX; -# endif #endif #ifdef PNG_SETJMP_SUPPORTED diff --git a/pngrutil.c b/pngrutil.c index 58a5588d0..0a8baf877 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.9 [February 18, 2012] + * Last changed in libpng 1.4.10 [February 20, 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.) @@ -379,14 +379,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");