diff --git a/ANNOUNCE b/ANNOUNCE index b462c6aa1..b62f18113 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.22beta01 - January 13, 2015 +Libpng 1.5.22beta01 - January 28, 2015 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. @@ -27,10 +27,11 @@ Other information: Changes since the last public release (1.5.21): -Version 1.5.22beta01 [January 13, 2015] +Version 1.5.22beta01 [January 28, 2015] Regenerated configure scripts with libtool-2.4.4 Made the check for out-of-range values in png_set_tRNS() detect values that are exactly 2^bit_depth, and work on 16-bit platforms. + Quieted some warnings from Coverity-scan. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index b5dec2b0b..09198e505 100644 --- a/CHANGES +++ b/CHANGES @@ -4291,10 +4291,11 @@ Version 1.5.21rc03 [December 21, 2014] Version 1.5.21 [December 22, 2014] No changes. -Version 1.5.22beta01 [January 13, 2015] +Version 1.5.22beta01 [January 28, 2015] Regenerated configure scripts with libtool-2.4.4 Made the check for out-of-range values in png_set_tRNS() detect values that are exactly 2^bit_depth, and work on 16-bit platforms. + Quieted some warnings from Coverity-scan. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/LICENSE b/LICENSE index dacb6fb6c..52898c167 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, December 22, 2014, are +libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, January 28, 2015, are Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -December 22, 2014 +January 28, 2015 diff --git a/README b/README index 6a0babc9a..baa30bb51 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.5.22beta01 - December 22, 2014 (shared library 15.0) +README for libpng version 1.5.22beta01 - January 28, 2015 (shared library 15.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/libpng-manual.txt b/libpng-manual.txt index 8dcc1360c..6083a7568 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ Libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.22beta01 - December 22, 2014 + libpng version 1.5.22beta01 - January 28, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ Libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.22beta01 - December 22, 2014 + libpng versions 0.97, January 1998, through 1.5.22beta01 - January 28, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -4531,7 +4531,7 @@ Other rules can be inferred by inspecting the libpng source. XIV. Y2K Compliance in libpng -December 22, 2014 +January 28, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. diff --git a/libpng.3 b/libpng.3 index 5bf49f0dd..b8399e5ab 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "December 22, 2014" +.TH LIBPNG 3 "January 28, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.5.22beta01 .SH SYNOPSIS @@ -492,7 +492,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT Libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.22beta01 - December 22, 2014 + libpng version 1.5.22beta01 - January 28, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -503,7 +503,7 @@ Libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.22beta01 - December 22, 2014 + libpng versions 0.97, January 1998, through 1.5.22beta01 - January 28, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -5023,7 +5023,7 @@ Other rules can be inferred by inspecting the libpng source. .SH XIV. Y2K Compliance in libpng -December 22, 2014 +January 28, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. @@ -5330,7 +5330,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.5.22beta01 - December 22, 2014: +Libpng version 1.5.22beta01 - January 28, 2015: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -5353,7 +5353,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, December 22, 2014, are +libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, January 28, 2015, are Copyright (c) 2004,2006-20014 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -5452,7 +5452,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -December 22, 2014 +January 28, 2015 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index e0808b7e2..52bb4ecb3 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,4 +1,4 @@ -.TH LIBPNGPF 3 "December 22, 2014" +.TH LIBPNGPF 3 "January 28, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.5.22beta01 (private functions) diff --git a/png.5 b/png.5 index ff6083ce6..b27d180ae 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "December 22, 2014" +.TH PNG 5 "January 28, 2015" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.c b/png.c index 2d643305c..4132f4d78 100644 --- a/png.c +++ b/png.c @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.5.21 [December 22, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.5.22 [(PENDING RELEASE)] + * Copyright (c) 1998-2015 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.) * @@ -149,9 +149,10 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length) do { uInt safeLength = (uInt)length; +#ifndef __COVERITY__ if (safeLength == 0) safeLength = (uInt)-1; /* evil, but safe */ - +#endif crc = crc32(crc, ptr, safeLength); /* The following should never issue compiler warnings, if they do the @@ -660,13 +661,13 @@ png_get_copyright(png_const_structp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.5.22beta01 - December 22, 2014" PNG_STRING_NEWLINE \ + "libpng version 1.5.22beta01 - January 28, 2015" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.5.22beta01 - December 22, 2014\ + return "libpng version 1.5.22beta01 - January 28, 2015\ Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -2081,17 +2082,20 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times, png_fixed_point png_reciprocal(png_fixed_point a) { + if (a != 0) + { #ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = floor(1E10/a+.5); + double r = floor(1E10/a+.5); - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; + if (r <= 2147483647. && r >= -2147483648.) + return (png_fixed_point)r; #else - png_fixed_point res; + png_fixed_point res; - if (png_muldiv(&res, 100000, 100000, a)) - return res; + if (png_muldiv(&res, 100000, 100000, a)) + return res; #endif + } return 0; /* error/overflow */ } @@ -2126,23 +2130,26 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b) { /* The required result is 1/a * 1/b; the following preserves accuracy. */ #ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = 1E15/a; - r /= b; - r = floor(r+.5); + if (a != 0 && b != 0) + { + double r = 1E15/a; + r /= b; + r = floor(r+.5); - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; + if (r <= 2147483647. && r >= -2147483648.) + return (png_fixed_point)r; #else - /* This may overflow because the range of png_fixed_point isn't symmetric, - * but this API is only used for the product of file and screen gamma so it - * doesn't matter that the smallest number it can produce is 1/21474, not - * 1/100000 - */ - png_fixed_point res = png_product2(a, b); + /* This may overflow because the range of png_fixed_point isn't + * symmetric, but this API is only used for the product of file and + * screen gamma so it doesn't matter that the smallest number it can + * produce is 1/21474, not 1/100000 + */ + png_fixed_point res = png_product2(a, b); - if (res != 0) - return png_reciprocal(res); + if (res != 0) + return png_reciprocal(res); #endif + } return 0; /* overflow */ } diff --git a/png.h b/png.h index 4e10e027c..a27bd6861 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.22beta01 - December 22, 2014 + * libpng version 1.5.22beta01 - January 28, 2015 * Copyright (c) 1998-2014 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.) @@ -11,7 +11,7 @@ * Authors and maintainers: * 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.97, January 1998, through 1.5.22beta01 - December 22, 2014: Glenn + * libpng versions 0.97, January 1998, through 1.5.22beta01 - January 28, 2015: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -237,7 +237,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, December 22, 2014, are + * libpng versions 1.2.6, August 15, 2004, through 1.5.22beta01, January 28, 2015, are * Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: @@ -349,7 +349,7 @@ * Y2K compliance in libpng: * ========================= * - * December 22, 2014 + * January 28, 2015 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -418,7 +418,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.5.22beta01" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.22beta01 - December 22, 2014\n" + " libpng version 1.5.22beta01 - January 28, 2015\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 diff --git a/pngconf.h b/pngconf.h index 4773b7a0a..55a8818ee 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.5.22beta01 - December 22, 2014 + * libpng version 1.5.22beta01 - January 28, 2015 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngrtran.c b/pngrtran.c index d0684c24f..bdb51fcf6 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.5.19 [August 21, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.5.22 [(PENDING RELEASE)] + * Copyright (c) 1998-2015 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.) * @@ -3341,11 +3341,17 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) for (i = 0; i < row_width; i++) { png_uint_16 red, green, blue, w; - +#if 0 /* Coverity doesn't like this */ red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; +#else + png_byte hi,lo; + hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo)); +#endif if (red == green && red == blue) { if (png_ptr->gamma_16_table != NULL) diff --git a/pngrutil.c b/pngrutil.c index b46dced1e..4c0493366 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.5.21 [December 22, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.5.22 [(PENDING RELEASE)] + * Copyright (c) 1998-2015 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.) * @@ -2549,20 +2549,23 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) * compression type]". The compression flag shall be 0 (no compression) or * 1 (compressed with method 0 - deflate.) */ - if (comp_flag != 0 && comp_flag != 1) + if (comp_flag/*compressed*/ != 0) { - png_warning(png_ptr, "invalid iTXt compression flag"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; - } + if (comp_flag != 1) + { + png_warning(png_ptr, "invalid iTXt compression flag"); + png_free(png_ptr, png_ptr->chunkdata); + png_ptr->chunkdata = NULL; + return; + } - if (comp_flag/*compressed*/ && comp_type != 0) - { - png_warning(png_ptr, "unknown iTXt compression type"); - png_free(png_ptr, png_ptr->chunkdata); - png_ptr->chunkdata = NULL; - return; + if (comp_type != 0) + { + png_warning(png_ptr, "unknown iTXt compression type"); + png_free(png_ptr, png_ptr->chunkdata); + png_ptr->chunkdata = NULL; + return; + } } for (lang_key = lang; *lang_key; lang_key++) diff --git a/pngset.c b/pngset.c index 64d452de7..4886d8d30 100644 --- a/pngset.c +++ b/pngset.c @@ -2,7 +2,7 @@ /* pngset.c - storage of image information into info struct * * Last changed in libpng 1.5.22 [(PENDING RELEASE)] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Copyright (c) 1998-2015 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.) * diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt index d26594be0..3907b6ec2 100644 --- a/projects/vstudio/readme.txt +++ b/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.5.22beta01 - December 22, 2014 +libpng version 1.5.22beta01 - January 28, 2015 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index 1f4d60bdc..78e1d9b0d 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@