From 90dd185aeda890024579cbd7bbe7950202c35573 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Fri, 22 Sep 2017 17:29:59 -0500 Subject: [PATCH] [libpng16] Removed more redundant tests (suggested by "irwir" in Github issue #180). --- ANNOUNCE | 1 + CHANGES | 1 + pngrutil.c | 6 ++---- pngwrite.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 4d2f50bb9..72411ab1f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -58,6 +58,7 @@ Version 1.6.33rc01 [September 20, 2017] Version 1.6.33rc02 [September 22, 2017] Added an interlaced version of each file in contrib/pngsuite. Relocate new memset() call in pngrutil.c. + Removed more redundant tests (suggested by "irwir" in Github issue #180). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 65e4cb370..f6ba9dd56 100644 --- a/CHANGES +++ b/CHANGES @@ -6028,6 +6028,7 @@ Version 1.6.33rc01 [September 20, 2017] Version 1.6.33rc02 [September 22, 2017] Added an interlaced version of each file in contrib/pngsuite. Relocate new memset() call in pngrutil.c. + Removed more redundant tests (suggested by "irwir" in Github issue #180). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngrutil.c b/pngrutil.c index fb6d6b7a2..5f0fe5ba0 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1585,11 +1585,9 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) } } - else if (size > 0) - errmsg = "truncated"; - + errmsg = "truncated"; #ifndef __COVERITY__ - else + if (size == 0) errmsg = png_ptr->zstream.msg; #endif } diff --git a/pngwrite.c b/pngwrite.c index a7662acb7..a16d77ce0 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1940,7 +1940,7 @@ png_image_write_main(png_voidp argument) int colormap = (format & PNG_FORMAT_FLAG_COLORMAP); int linear = !colormap && (format & PNG_FORMAT_FLAG_LINEAR); /* input */ int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA); - int write_16bit = linear && !colormap && (display->convert_to_8bit == 0); + int write_16bit = linear && (display->convert_to_8bit == 0); # ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Make sure we error out on any bad situation */