From 03a53fa4296fae9b1b009783f058513567d0b281 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Fri, 10 Jan 2014 06:22:41 -0600 Subject: [PATCH] [libpng17] Removed potentially misleading warning from png_check_IHDR(). --- ANNOUNCE | 3 +-- CHANGES | 3 +-- png.c | 11 ----------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index c21334e7c..c7d7fb86c 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -487,8 +487,7 @@ Version 1.7.0beta26 [January 1, 2014] rearrangement of Makefile.am allow creation of these links to be disabled. Version 1.7.0beta27 [January 10, 2014] - Revised png_check_IHDR() to use PNG_SIZE_MAX instead of PNG_UINT_32_MAX - in the test for potential overflow in PNG_ROWBYTES. + Removed potentially misleading warning from png_check_IHDR(). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 62b9547fb..cdf6f7b51 100644 --- a/CHANGES +++ b/CHANGES @@ -4776,8 +4776,7 @@ Version 1.7.0beta26 [January 1, 2014] rearrangement of Makefile.am allow creation of these links to be disabled. Version 1.7.0beta27 [January 10, 2014] - Revised png_check_IHDR() to use PNG_SIZE_MAX instead of PNG_UINT_32_MAX - in the test for potential overflow in PNG_ROWBYTES. + Removed potentially misleading warning from png_check_IHDR(). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.c b/png.c index ea11d1b36..46ca3967d 100644 --- a/png.c +++ b/png.c @@ -2381,17 +2381,6 @@ png_check_IHDR(png_const_structrp png_ptr, error = 1; } - /* Check for potential overflow in PNG_ROWBYTES calculation */ - if (error == 0 && width > (PNG_SIZE_MAX - >> 3) /* 8-byte RGBA pixels */ - - 48 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8 /* extra max_pixel_depth pad */ - - error) /* to prevent always-false compiler warning */ - png_warning(png_ptr, - "Width may be too large for libpng to process pixels"); - /* Check other values */ if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && bit_depth != 8 && bit_depth != 16)