[libpng14] Quieted more harmless warnings from Coverity-scan.

This commit is contained in:
Glenn Randers-Pehrson 2015-02-06 11:57:17 -06:00
parent 83e10a6347
commit 4743e9e892
4 changed files with 40 additions and 32 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.15rc01 - February 5, 2015 Libpng 1.4.15rc02 - February 6, 2015
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -9,21 +9,21 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
1.4.15rc01.tar.xz (LZMA-compressed, recommended) 1.4.15rc02.tar.xz (LZMA-compressed, recommended)
1.4.15rc01.tar.gz 1.4.15rc02.tar.gz
1.4.15rc01.tar.bz2 1.4.15rc02.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp1415r01.7z (LZMA-compressed, recommended) lp1415r02.7z (LZMA-compressed, recommended)
lp1415r01.zip lp1415r02.zip
Other information: Other information:
1.4.15rc01-README.txt 1.4.15rc02-README.txt
1.4.15rc01-LICENSE.txt 1.4.15rc02-LICENSE.txt
libpng-1.4.15rc01-*.asc (armored detached GPG signatures) libpng-1.4.15rc02-*.asc (armored detached GPG signatures)
Changes since the last public release (1.4.14): Changes since the last public release (1.4.14):
@ -37,6 +37,9 @@ version 1.4.15beta02 [January 30, 2015]
version 1.4.15rc01 [February 5, 2015] version 1.4.15rc01 [February 5, 2015]
No changes. No changes.
version 1.4.15rc02 [February 6, 2015]
Quieted more harmless warnings from Coverity-scan.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement). https://lists.sourceforge.net/lists/listinfo/png-mng-implement).

View File

@ -2932,6 +2932,9 @@ version 1.4.15beta02 [January 30, 2015]
version 1.4.15rc01 [February 5, 2015] version 1.4.15rc01 [February 5, 2015]
No changes. No changes.
version 1.4.15rc02 [February 6, 2015]
Quieted more harmless warnings from Coverity-scan.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement). https://lists.sourceforge.net/lists/listinfo/png-mng-implement).

28
png.h
View File

@ -1,8 +1,8 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.4.15rc01 - February 5, 2015 * libpng version 1.4.15rc02 - February 6, 2015
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -11,7 +11,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.4.15rc01 - February 5, 2015: Glenn * libpng versions 0.97, January 1998, through 1.4.15rc02 - February 6, 2015: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -209,7 +209,7 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.2.6, August 15, 2004, through 1.4.15rc01, February 5, 2015, are * libpng versions 1.2.6, August 15, 2004, through 1.4.15rc02, February 6, 2015, are
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5 * distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors: * with the following individual added to the list of Contributing Authors:
@ -321,13 +321,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* February 5, 2015 * February 6, 2015
* *
* Since the PNG Development group is an ad-hoc body, we can't make * Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration. * an official declaration.
* *
* This is your unofficial assurance that libpng from version 0.71 and * This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.4.15rc01 are Y2K compliant. It is my belief that earlier * upward through 1.4.15rc02 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant. * versions were also Y2K compliant.
* *
* Libpng only has three year fields. One is a 2-byte unsigned integer * Libpng only has three year fields. One is a 2-byte unsigned integer
@ -383,9 +383,9 @@
*/ */
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.4.15rc01" #define PNG_LIBPNG_VER_STRING "1.4.15rc02"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.4.15rc01 - February 5, 2015\n" " libpng version 1.4.15rc02 - February 6, 2015\n"
#define PNG_LIBPNG_VER_SONUM 14 #define PNG_LIBPNG_VER_SONUM 14
#define PNG_LIBPNG_VER_DLLNUM 14 #define PNG_LIBPNG_VER_DLLNUM 14
@ -398,7 +398,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/ */
#define PNG_LIBPNG_VER_BUILD 01 #define PNG_LIBPNG_VER_BUILD 02
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@ -1509,7 +1509,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h /* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number. * do not agree upon the version number.
*/ */
typedef png_structp version_1_4_15rc01; typedef png_structp version_1_4_15rc02;
typedef png_struct FAR * FAR * png_structpp; typedef png_struct FAR * FAR * png_structpp;
@ -2675,10 +2675,10 @@ PNG_EXPORT(png_bytep,png_get_io_chunk_name)
* format for negative values, which is almost certainly true. * format for negative values, which is almost certainly true.
*/ */
# define png_get_uint_32(buf) \ # define png_get_uint_32(buf) \
(((png_uint_32)(*(buf)) << 24) + \ (((png_uint_32)((*(buf)) & 0xff) << 24) + \
((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)((*((buf) + 1)) & 0xff) << 16) + \
((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)((*((buf) + 2)) & 0xff) << 8) + \
((png_uint_32)(*((buf) + 3)))) ((png_uint_32)((*((buf) + 3)) & 0xff)))
/* The following definition introduces an API incompatibility (but not /* The following definition introduces an API incompatibility (but not
* an ABI incompatibility) with libpng-1.4.0 through 1.4.4. Prior to * an ABI incompatibility) with libpng-1.4.0 through 1.4.4. Prior to

View File

@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.4.10 [March 8, 2012] * Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson * Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -73,9 +73,8 @@ png_get_uint_16)(png_bytep buf)
* on 32 bit systems. (Pre-ANSI systems did not make integers smaller * on 32 bit systems. (Pre-ANSI systems did not make integers smaller
* than 16 bits either.) * than 16 bits either.)
*/ */
unsigned int val = unsigned int val = ((unsigned int)((*(buf )) & 0xff) << 8) +
((unsigned int)(*buf) << 8) + ((unsigned int)((*(buf + 1)) & 0xff) );
((unsigned int)(*(buf + 1)));
return (png_uint_16)val; return (png_uint_16)val;
} }
@ -332,12 +331,15 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name); png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name);
msg = umsg; msg = umsg;
png_warning(png_ptr, msg);
#else #else
msg = "Damaged compressed datastream in chunk other than IDAT"; msg = "Damaged compressed datastream in chunk other than IDAT";
#endif #endif
} }
#ifndef PNG_STDIO_SUPPORTED
png_warning(png_ptr, msg); png_warning(png_ptr, msg);
#endif
} }
/* 0 means an error - notice that this code simple ignores /* 0 means an error - notice that this code simple ignores
@ -1171,10 +1173,10 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Check the profile_size recorded in the first 32 bits of the ICC profile */ /* Check the profile_size recorded in the first 32 bits of the ICC profile */
pC = (png_bytep)(png_ptr->chunkdata + prefix_length); pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
profile_size = ((*(pC ))<<24) | profile_size = (((*(pC )) & 0xff) << 24) |
((*(pC + 1))<<16) | (((*(pC + 1)) & 0xff) << 16) |
((*(pC + 2))<< 8) | (((*(pC + 2)) & 0xff) << 8) |
((*(pC + 3)) ); (((*(pC + 3)) & 0xff) );
if (profile_size < profile_length) if (profile_size < profile_length)
profile_length = profile_size; profile_length = profile_size;