From 780079e771af0af4f28209d13edee03113b55921 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 13 Jan 2016 09:50:41 -0600 Subject: [PATCH] [libpng16] Worked around a false-positive Coverity issue in pngvalid.c. --- ANNOUNCE | 19 +++++++++++-------- CHANGES | 3 +++ contrib/libtests/pngvalid.c | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 697937fc6..2645db7f1 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -Libpng 1.6.21rc02 - January 7, 2016 +Libpng 1.6.21rc03 - January 13, 2016 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. @@ -8,20 +8,20 @@ Files available for download: Source files with LF line endings (for Unix/Linux) and with a "configure" script - 1.6.21rc02.tar.xz (LZMA-compressed, recommended) - 1.6.21rc02.tar.gz + 1.6.21rc03.tar.xz (LZMA-compressed, recommended) + 1.6.21rc03.tar.gz Source files with CRLF line endings (for Windows), without the "configure" script - /scratch/glennrp/Libpng16/lp1621r02.7z (LZMA-compressed, recommended) - /scratch/glennrp/Libpng16/lp1621r02.zip + /scratch/glennrp/Libpng16/lp1621r03.7z (LZMA-compressed, recommended) + /scratch/glennrp/Libpng16/lp1621r03.zip Other information: - 1.6.21rc02-README.txt - 1.6.21rc02-LICENSE.txt - libpng-1.6.21rc02-*.asc (armored detached GPG signatures) + 1.6.21rc03-README.txt + 1.6.21rc03-LICENSE.txt + libpng-1.6.21rc03-*.asc (armored detached GPG signatures) Changes since the last public release (1.6.20): @@ -60,6 +60,9 @@ Version 1.6.21rc02 [January 7, 2016] Marked 'limit' UNUSED in transform_range_check(). This only affects release builds. +Version 1.6.21rc03 [January 13, 2016] + Worked around a false-positive Coverity issue in pngvalid.c. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/CHANGES b/CHANGES index a35226e2f..1da6b8cad 100644 --- a/CHANGES +++ b/CHANGES @@ -5481,6 +5481,9 @@ Version 1.6.21rc02 [January 7, 2016] Marked 'limit' UNUSED in transform_range_check(). This only affects release builds. +Version 1.6.21rc03 [January 13, 2016] + Worked around a false-positive Coverity issue in pngvalid.c. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 407a0f66e..9063b69fe 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -309,8 +309,13 @@ static void r16(png_uint_16p p16, size_t count) } } -#define R16(this)\ +#ifdef __COVERITY__ +# define R16(this)\ + r16(&(this), (sizeof (this))/2U/*(sizeof (png_uint_16))*/) +#else +# define R16(this)\ r16(&(this), (sizeof (this))/(sizeof (png_uint_16))) +#endif #if defined PNG_READ_RGB_TO_GRAY_SUPPORTED ||\ defined PNG_READ_FILLER_SUPPORTED @@ -326,8 +331,14 @@ static void r32(png_uint_32p p32, size_t count) } } -#define R32(this)\ +#ifdef __COVERITY__ +# define R32(this)\ + r32(&(this), (sizeof (this))/4U/*(sizeof (png_uint_32))*/) +#else +# define R32(this)\ r32(&(this), (sizeof (this))/(sizeof (png_uint_32))) +#endif + #endif /* READ_FILLER || READ_RGB_TO_GRAY */ #endif /* READ || WRITE_tRNS || WRITE_FILTER */