From 1c2e35ab73ee031399c13082d0acd786e99f9a9e Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 6 Aug 2017 14:03:25 -0500 Subject: [PATCH] [libpng17] Imported from libpng-1.7.0beta88.tar --- LICENSE | 4 ++-- README | 2 +- contrib/gregbook/README | 2 +- contrib/libtests/pngstest.c | 30 ++++++++++++++++++++---------- libpng-manual.txt | 20 +++++++++++++------- libpng.3 | 30 ++++++++++++++++++------------ libpngpf.3 | 2 +- png.5 | 2 +- png.c | 4 ++-- png.h | 10 +++++----- pngconf.h | 2 +- projects/vstudio/README.txt | 2 +- projects/vstudio/zlib.props | 2 +- scripts/README.txt | 2 +- scripts/pnglibconf.h.prebuilt | 2 +- 15 files changed, 69 insertions(+), 47 deletions(-) diff --git a/LICENSE b/LICENSE index 2151113e2..7735d655b 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, April 1, 2017 are +libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, August 6, 2017 are Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals @@ -127,4 +127,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and Glenn Randers-Pehrson glennrp at users.sourceforge.net -April 1, 2017 +August 6, 2017 diff --git a/README b/README index 174d5addd..c33f5f6e2 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.7.0beta88 - May 22, 2017 (shared library 17.0) +README for libpng version 1.7.0beta88 - August 6, 2017 (shared library 17.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/contrib/gregbook/README b/contrib/gregbook/README index edaf2b722..171c5fd43 100644 --- a/contrib/gregbook/README +++ b/contrib/gregbook/README @@ -63,7 +63,7 @@ BUILD INSTRUCTIONS - Prerequisites (in order of compilation): - - zlib http://zlib.net/ + - zlib https://zlib.net/ - libpng http://www.libpng.org/pub/png/libpng.html - pngbook http://www.libpng.org/pub/png/book/sources.html diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index 30f57a966..ab4508930 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -1,9 +1,8 @@ /*- * pngstest.c * - * Copyright (c) 2013-2016 John Cunningham Bowler - * - * Last changed in libpng 1.6.24 [August 4, 2016] + * Last changed in libpng 1.6.31 [July 27, 2017] + * Copyright (c) 2013-2017 John Cunningham Bowler * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -2611,9 +2610,9 @@ compare_two_images(Image *a, Image *b, int via_linear, const unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb); int alpha_added, alpha_removed; int bchannels; - int btoa[4]; png_uint_32 y; Transform tr; + int btoa[4]={0,0,0,0}; /* This should never happen: */ if (width != b->image.width || height != b->image.height) @@ -2746,22 +2745,27 @@ compare_two_images(Image *a, Image *b, int via_linear, */ else if ((a->opts & ACCUMULATE) == 0) { +# ifdef __GNUC__ +# define BYTE_CHARS 20 /* 2^32: GCC sprintf warning */ +# else +# define BYTE_CHARS 3 /* 2^8: real maximum value */ +# endif /* Check the original image first, * TODO: deal with input images with bad pixel values? */ if (amax >= a->image.colormap_entries) { - char pindex[9]; - sprintf(pindex, "%d[%lu]", amax, - (unsigned long)a->image.colormap_entries); + char pindex[3+2*BYTE_CHARS]; + sprintf(pindex, "%d[%u]", amax, + (png_byte)/*SAFE*/a->image.colormap_entries); return logerror(a, a->file_name, ": bad pixel index: ", pindex); } else if (bmax >= b->image.colormap_entries) { - char pindex[9]; - sprintf(pindex, "%d[%lu]", bmax, - (unsigned long)b->image.colormap_entries); + char pindex[3+2*BYTE_CHARS]; + sprintf(pindex, "%d[%u]", bmax, + (png_byte)/*SAFE*/b->image.colormap_entries); return logerror(b, b->file_name, ": bad pixel index: ", pindex); } } @@ -2881,10 +2885,13 @@ compare_two_images(Image *a, Image *b, int via_linear, { case 4: if (pua[btoa[3]] != pub[3]) break; + /* FALLTHROUGH */ case 3: if (pua[btoa[2]] != pub[2]) break; + /* FALLTHROUGH */ case 2: if (pua[btoa[1]] != pub[1]) break; + /* FALLTHROUGH */ case 1: if (pua[btoa[0]] != pub[0]) break; if (alpha_added != 4 && pub[alpha_added] != 65535) break; @@ -2900,10 +2907,13 @@ compare_two_images(Image *a, Image *b, int via_linear, { case 4: if (psa[btoa[3]] != psb[3]) break; + /* FALLTHROUGH */ case 3: if (psa[btoa[2]] != psb[2]) break; + /* FALLTHROUGH */ case 2: if (psa[btoa[1]] != psb[1]) break; + /* FALLTHROUGH */ case 1: if (psa[btoa[0]] != psb[0]) break; if (alpha_added != 4 && psb[alpha_added] != 255) break; diff --git a/libpng-manual.txt b/libpng-manual.txt index 172aa719a..5794f6557 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.7.0beta88 - May 22, 2017 + libpng version 1.7.0beta88 - August 6, 2017 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2017 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.7.0beta88 - May 22, 2017 + libpng versions 0.97, January 1998, through 1.7.0beta88 - August 6, 2017 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -102,7 +102,7 @@ majority of the needs of its users. Libpng uses zlib for its compression and decompression of PNG files. Further information about zlib, and the latest version of zlib, can -be found at the zlib home page, . +be found at the zlib home page, . The zlib compression utility is a general purpose utility that is useful for more than PNG files, and can be used without libpng. See the documentation delivered with zlib for more details. @@ -5189,11 +5189,13 @@ control. The git repository was built from old libpng-x.y.z.tar.gz files going back to version 0.70. You can access the git repository (read only) at - git://git.code.sf.net/p/libpng/code.git + https://github.com/glennrp/libpng or + https://git.code.sf.net/p/libpng/code.git -or you can browse it with a web browser by selecting the "code" button at +or you can browse it with a web browser at - https://sourceforge.net/projects/libpng + https://github.com/glennrp/libpng or + https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ Patches can be sent to glennrp at users.sourceforge.net or to png-mng-implement at lists.sourceforge.net or you can upload them to @@ -5201,10 +5203,14 @@ the libpng bug tracker at https://libpng.sourceforge.io/ +or as a "pull request" to + + https://github.com/glennrp/libpng/pulls + We also accept patches built from the tar or zip distributions, and simple verbal discriptions of bug fixes, reported either to the SourceForge bug tracker, to the png-mng-implement at lists.sf.net -mailing list, or directly to glennrp. +mailing list, as github issues, or directly to glennrp. XVI. Coding style diff --git a/libpng.3 b/libpng.3 index a1b3fc018..f33e5d2b2 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "May 22, 2017" +.TH LIBPNG 3 "August 6, 2017" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta88 .SH SYNOPSIS @@ -500,7 +500,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.7.0beta88 - May 22, 2017 + libpng version 1.7.0beta88 - August 6, 2017 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson @@ -511,7 +511,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.7.0beta88 - May 22, 2017 + libpng versions 0.97, January 1998, through 1.7.0beta88 - August 6, 2017 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -602,7 +602,7 @@ majority of the needs of its users. Libpng uses zlib for its compression and decompression of PNG files. Further information about zlib, and the latest version of zlib, can -be found at the zlib home page, . +be found at the zlib home page, . The zlib compression utility is a general purpose utility that is useful for more than PNG files, and can be used without libpng. See the documentation delivered with zlib for more details. @@ -5689,11 +5689,13 @@ control. The git repository was built from old libpng-x.y.z.tar.gz files going back to version 0.70. You can access the git repository (read only) at - git://git.code.sf.net/p/libpng/code.git + https://github.com/glennrp/libpng or + https://git.code.sf.net/p/libpng/code.git -or you can browse it with a web browser by selecting the "code" button at +or you can browse it with a web browser at - https://sourceforge.net/projects/libpng + https://github.com/glennrp/libpng or + https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ Patches can be sent to glennrp at users.sourceforge.net or to png-mng-implement at lists.sourceforge.net or you can upload them to @@ -5701,10 +5703,14 @@ the libpng bug tracker at https://libpng.sourceforge.io/ +or as a "pull request" to + + https://github.com/glennrp/libpng/pulls + We also accept patches built from the tar or zip distributions, and simple verbal discriptions of bug fixes, reported either to the SourceForge bug tracker, to the png-mng-implement at lists.sf.net -mailing list, or directly to glennrp. +mailing list, as github issues, or directly to glennrp. .SH XVI. Coding style @@ -5991,7 +5997,7 @@ http://www.libpng.org/pub/png .I libpng or at .br -http://zlib.net/ +https://zlib.net/ .LP .IR PNG specification: RFC 2083 @@ -6020,7 +6026,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.7.0beta88 - May 22, 2017: +Libpng version 1.7.0beta88 - August 6, 2017: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6045,7 +6051,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, May 22, 2017 are +libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, August 6, 2017 are Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals @@ -6170,7 +6176,7 @@ files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). Glenn Randers-Pehrson glennrp at users.sourceforge.net -May 22, 2017 +August 6, 2017 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index 3c7db65b8..4053c656d 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,4 +1,4 @@ -.TH LIBPNGPF 3 "April 1, 2017" +.TH LIBPNGPF 3 "August 6, 2017" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta88 (private functions) diff --git a/png.5 b/png.5 index 4fdc9f02f..40a450f65 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "April 1, 2017" +.TH PNG 5 "August 6, 2017" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.c b/png.c index af0bdc8b8..68f5bbd26 100644 --- a/png.c +++ b/png.c @@ -705,14 +705,14 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.7.0beta88 - April 1, 2017" PNG_STRING_NEWLINE \ + "libpng version 1.7.0beta88 - August 6, 2017" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2017 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.7.0beta88 - April 1, 2017\ + return "libpng version 1.7.0beta88 - August 6, 2017\ Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; diff --git a/png.h b/png.h index c716291d2..7f3af6c4c 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.7.0beta88, April 1, 2017 + * libpng version 1.7.0beta88, August 6, 2017 * * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -12,7 +12,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.7.0beta88, April 1, 2017: + * libpng versions 0.97, January 1998, through 1.7.0beta88, August 6, 2017: * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ @@ -25,7 +25,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, April 1, 2017 are + * libpng versions 1.0.7, July 1, 2000 through 1.7.0beta88, August 6, 2017 are * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are * derived from libpng-1.0.6, and are distributed according to the same * disclaimer and license as libpng-1.0.6 with the following individuals @@ -241,7 +241,7 @@ * Y2K compliance in libpng: * ========================= * - * April 1, 2017 + * August 6, 2017 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -310,7 +310,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.7.0beta88" -#define PNG_HEADER_VERSION_STRING " libpng version 1.7.0beta88 - April 1, 2017\n" +#define PNG_HEADER_VERSION_STRING " libpng version 1.7.0beta88 - August 6, 2017\n" #define PNG_LIBPNG_VER_SONUM 17 #define PNG_LIBPNG_VER_DLLNUM 17 diff --git a/pngconf.h b/pngconf.h index 1b1bba9ee..21f15fe8d 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.7.0beta88, April 1, 2017 + * libpng version 1.7.0beta88, August 6, 2017 * * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/projects/vstudio/README.txt b/projects/vstudio/README.txt index 637a9c13f..b3367d166 100644 --- a/projects/vstudio/README.txt +++ b/projects/vstudio/README.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.7.0beta88 - April 1, 2017 +libpng version 1.7.0beta88 - August 6, 2017 Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index e1a4a6572..78a035c54 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@