From 648f543b0cc747f47e77a68f2e22c7513aea7f32 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 4 Jun 2013 15:01:38 -0500 Subject: [PATCH] [libpng14] Removed a redundant test from png_set_IHDR(). --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- pngset.c | 13 ++----------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 23a9d16a4..704d0e160 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.4.13beta03 - March 1, 2013 +Libpng 1.4.13beta03 - June 4, 2013 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. @@ -42,8 +42,9 @@ version 1.4.13beta02 [January 22, 2013] in configure.ac Changed default value of PNG_USER_CACHE_MAX from 0 to 32767 in pngconf.h. -version 1.4.13beta03 [March 1, 2013] +version 1.4.13beta03 [June 4, 2013] Avoid a possible memory leak in contrib/gregbook/readpng.c + Removed a redundant test from png_set_IHDR(). 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 9e32307f3..0e6a66fbe 100644 --- a/CHANGES +++ b/CHANGES @@ -2884,8 +2884,9 @@ version 1.4.13beta02 [January 22, 2013] in configure.ac Changed default value of PNG_USER_CACHE_MAX from 0 to 32767 in pngconf.h. -version 1.4.13beta03 [March 1, 2013] +version 1.4.13beta03 [June 4, 2013] Avoid a possible memory leak in contrib/gregbook/readpng.c + Removed a redundant test from png_set_IHDR(). 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/pngset.c b/pngset.c index fd8137513..27701ee3a 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.13 [January 22, 2013] + * Last changed in libpng 1.4.13 [June 4, 2013] * Copyright (c) 1998-2013 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.) @@ -250,16 +250,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr, info_ptr->channels++; info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); - /* Check for potential overflow */ - if (width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - info_ptr->rowbytes = 0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); + info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); } #ifdef PNG_oFFs_SUPPORTED