Compare commits

...

20 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
69ddffdf2c [libpng17] Use a more generous size limit for IDAT chunks. 2017-09-03 09:20:23 -05:00
Glenn Randers-Pehrson
3e2769b9d7 [libpng17] Bump version to 1.7.0beta90 2017-08-28 18:34:49 -05:00
Glenn Randers-Pehrson
780d38b87d [libpng17]Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
2017-08-28 14:17:52 -05:00
Glenn Randers-Pehrson
031a3815ae [libpng17] Bump version to 1.7.0beta90 2017-08-18 20:23:56 -05:00
Glenn Randers-Pehrson
ef5a5760d4 [libpng17] Imported from libpng-1.7.0beta89.tar 2017-08-18 20:22:58 -05:00
Glenn Randers-Pehrson
0b2b7d8ab5 [libpng17] Imported from libpng-1.7.0beta88.tar 2017-08-18 20:01:40 -05:00
Glenn Randers-Pehrson
1c2e35ab73 [libpng17] Imported from libpng-1.7.0beta88.tar 2017-08-07 09:45:14 -05:00
Glenn Randers-Pehrson
58cd558a43 [libpng17] Added some bad PNGs to the test directory and to the test/pngtest script 2017-08-06 14:16:17 -05:00
Glenn Randers-Pehrson
bdca749e35 [libpng17] Added private png_check_chunk_name() and png_check_chunk_length()
functions.
2017-08-06 14:13:18 -05:00
Glenn Randers-Pehrson
19855cd8b1 [libpng17] Fix URL in documentation. 2017-05-22 17:39:22 -05:00
Glenn Randers-Pehrson
9bda575f69 [libpng17] Change http: urls to https: in libpng.3 2017-04-03 16:58:43 -05:00
Glenn Randers-Pehrson
66def3fb3c [libpng17] Bump version to 1.7.0beta88 2017-04-01 11:29:32 -05:00
Glenn Randers-Pehrson
8f4d83a881 [libpng17] Imported from libpng-1.7.0beta87.tar 2017-04-01 11:29:12 -05:00
Glenn Randers-Pehrson
a9b02399ac [libpng17] Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
2017-03-21 20:12:09 -05:00
Glenn Randers-Pehrson
ba42eccb05 [libpng17] Merge contrib/examples/pngtopng.c with libpng-1.6.29beta02 2017-02-24 09:25:27 -06:00
Glenn Randers-Pehrson
7345c50aaa [libpng17] Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna) 2016-12-31 13:02:01 -06:00
Glenn Randers-Pehrson
20be5b5411 [libpng16] Mention CVE-2016-10087 in CHANGES. 2016-12-30 14:00:44 -06:00
Glenn Randers-Pehrson
750a023377 [libpng17] Merge license info from libpng-1.6.27 2016-12-30 12:10:45 -06:00
Glenn Randers-Pehrson
e00c39596a [libpng17] Update license info from libpng-1.6.27 2016-12-30 10:27:53 -06:00
Glenn Randers-Pehrson
448fad2d02 [libpng17] Bump version to 1.7.0beta87 2016-12-30 08:29:13 -06:00
45 changed files with 472 additions and 212 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.7.0beta86 - December 29, 2016 Libpng 1.7.0beta90 - September 3, 2017
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,20 +9,20 @@ 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.7.0beta86.tar.xz (LZMA-compressed, recommended) 1.7.0beta90.tar.xz (LZMA-compressed, recommended)
1.7.0beta86.tar.gz 1.7.0beta90.tar.gz
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
/scratch/glennrp/Libpng17/lp170b86.7z (LZMA-compressed, recommended) /scratch/glennrp/Libpng17/lp170b90.7z (LZMA-compressed, recommended)
/scratch/glennrp/Libpng17/lp170b86.zip /scratch/glennrp/Libpng17/lp170b90.zip
Other information: Other information:
1.7.0beta86-README.txt 1.7.0beta90-README.txt
1.7.0beta86-LICENSE.txt 1.7.0beta90-LICENSE.txt
libpng-1.7.0beta86-*.asc (armored detached GPG signatures) libpng-1.7.0beta90-*.asc (armored detached GPG signatures)
Changes since the last public release (1.6.0): Changes since the last public release (1.6.0):
@@ -1421,7 +1421,29 @@ Version 1.7.0beta85 [December 27, 2016]
Version 1.7.0beta86 [December 29, 2016] Version 1.7.0beta86 [December 29, 2016]
Ported CMakeLists.txt from libpng-1.6.27rc01. Ported CMakeLists.txt from libpng-1.6.27rc01.
Fixed a potential null pointer dereference in png_set_text_2() (bug report Fixed a potential null pointer dereference in png_set_text_2() (bug report
and patch by Patrick Keshishian). and patch by Patrick Keshishian, CVE-2016-10087).
Version 1.7.0beta87 [April 1, 2017]
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
The contrib/examples/pngtopng.c recovery code was in the wrong "if"
branches; the comments were correct.
Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
Merged some recent changes from libpng-1.6.30beta01.
Version 1.7.0beta88 [August 7. 2017]
Added private png_check_chunk_name() and png_check_chunk_length()
functions (Fixes CVE-2017-12652).
Version 1.7.0beta89 [August 19, 2017]
Check for 0 return from png_get_rowbytes() in contrib/pngminus/*.c to stop
some Coverity issues (162705, 162706, and 162707).
Version 1.7.0beta90 [September 3, 2017]
Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
Compute a larger limit on IDAT because some applications write a deflate
buffer for each row (Bug report by Andrew Church).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

25
CHANGES
View File

@@ -5721,7 +5721,30 @@ Version 1.7.0beta85 [December 27, 2016]
Version 1.7.0beta86 [December 29, 2016] Version 1.7.0beta86 [December 29, 2016]
Ported CMakeLists.txt from libpng-1.6.27rc01. Ported CMakeLists.txt from libpng-1.6.27rc01.
Fixed a potential null pointer dereference in png_set_text_2() (bug report Fixed a potential null pointer dereference in png_set_text_2() (bug report
and patch by Patrick Keshishian). and patch by Patrick Keshishian, CVE-2016-10087).
Version 1.7.0beta87 [April 1, 2017]
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
The contrib/examples/pngtopng.c recovery code was in the wrong "if"
branches; the comments were correct.
Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
Merged some recent changes from libpng-1.6.30beta01.
Version 1.7.0beta88 [August 7, 2017]
Initialized btoa[] in pngstest.c
Added private png_check_chunk_name() and png_check_chunk_length()
functions (Fixes CVE-2017-12652).
Version 1.7.0beta89 [August 19, 2017]
Check for 0 return from png_get_rowbytes() in contrib/pngminus/*.c to stop
some Coverity issues (162705, 162706, and 162707).
Version 1.7.0beta90 [September 3, 2017]
Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
Compute a larger limit on IDAT because some applications write a deflate
buffer for each row (Bug report by Andrew Church).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@@ -71,7 +71,8 @@ set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings") set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
# set definitions and sources for arm # set definitions and sources for arm
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off) set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations: set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
check: (default) use internal checking code; check: (default) use internal checking code;
@@ -728,7 +729,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
# SET UP LINKS # SET UP LINKS
if(PNG_SHARED) if(PNG_SHARED)
set_target_properties(png PROPERTIES set_target_properties(png PROPERTIES
# VERSION 17.${PNGLIB_RELEASE}.1.7.0beta86 # VERSION 17.${PNGLIB_RELEASE}.1.7.0beta90
VERSION 17.${PNGLIB_RELEASE}.0 VERSION 17.${PNGLIB_RELEASE}.0
SOVERSION 17 SOVERSION 17
CLEAN_DIRECT_OUTPUT 1) CLEAN_DIRECT_OUTPUT 1)

34
LICENSE
View File

@@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000, through 1.7.0beta86, December 29, 2016, are libpng versions 1.0.7, July 1, 2000 through 1.7.0beta90, August 28, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, 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 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 disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors: added to the list of Contributing Authors:
@@ -32,6 +32,10 @@ and with the following additions to the disclaimer:
risk of satisfactory quality, performance, accuracy, and effort is with risk of satisfactory quality, performance, accuracy, and effort is with
the user. the user.
Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and libpng-0.96, and are distributed according to the same disclaimer and
@@ -55,6 +59,9 @@ Contributing Authors:
Greg Roelofs Greg Roelofs
Tom Tanner Tom Tanner
Some files in the "scripts" directory have other copyright owners
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -95,18 +102,29 @@ appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
A "png_get_copyright" function is available, for convenient use in "about" TRADEMARK:
boxes and the like:
printf("%s", png_get_copyright(NULL)); The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
Also, the PNG logo (in PNG format, of course) is supplied in the OSI CERTIFICATION:
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7. the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL:
The Copyright owner believes that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
December 29, 2016 August 28, 2017

12
README
View File

@@ -1,4 +1,4 @@
README for libpng version 1.7.0beta86 - December 29, 2016 (shared library 17.0) README for libpng version 1.7.0beta90 - August 28, 2017 (shared library 17.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
@@ -23,7 +23,7 @@ earlier versions if you are using a shared library. The type of the
png_uint_32, which will affect shared-library applications that use png_uint_32, which will affect shared-library applications that use
this function. this function.
To avoid problems with changes to the internals of png info_struct, To avoid problems with changes to the internals of the png info_struct,
new APIs have been made available in 0.95 to avoid direct application new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when png_get_<chunk> functions. These functions should be used when
@@ -88,11 +88,11 @@ zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/documents/ these at http://www.libpng.org/pub/png/pngdocs.html .
This code is currently being archived at libpng.sf.net in the This code is currently being archived at libpng.sourceforge.io in the
[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it [DOWNLOAD] area, and at ftp://ftp-osl.osuosl.org/pub/libpng/src . If you
in any of those places, e-mail me, and I'll help you find it. can't find it in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export Number (ECCN) for libpng is EAR99, which means not subject to export

View File

@@ -26,7 +26,7 @@ AC_PREREQ([2.68])
dnl Version number stuff here: dnl Version number stuff here:
AC_INIT([libpng],[1.7.0beta86],[png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng],[1.7.0beta90],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts]) AC_CONFIG_MACRO_DIR([scripts])
# libpng does not follow GNU file name conventions (hence 'foreign') # libpng does not follow GNU file name conventions (hence 'foreign')
@@ -48,7 +48,7 @@ dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2]) dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake dnl stop configure from automagically running automake
PNGLIB_VERSION=1.7.0beta86 PNGLIB_VERSION=1.7.0beta90
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=7 PNGLIB_MINOR=7
PNGLIB_RELEASE=0 PNGLIB_RELEASE=0

View File

@@ -17,7 +17,7 @@
* *
* Documentation: * Documentation:
* http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html * http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
* http://code.google.com/p/android/issues/detail?id=49065 * https://code.google.com/p/android/issues/detail?id=49065
* *
* NOTE: this requires that libpng is built against the Android NDK and linked * NOTE: this requires that libpng is built against the Android NDK and linked
* with an implementation of the Android ARM 'cpu-features' library. The code * with an implementation of the Android ARM 'cpu-features' library. The code

View File

@@ -1,10 +1,12 @@
/*- pngtopng /*- pngtopng
* *
* COPYRIGHT: Written by John Cunningham Bowler, 2011. * COPYRIGHT: Written by John Cunningham Bowler, 2011, 2017.
* To the extent possible under law, the author has waived all copyright and * To the extent possible under law, the author has waived all copyright and
* related or neighboring rights to this work. This work is published from: * related or neighboring rights to this work. This work is published from:
* United States. * United States.
* *
* Last changed in libpng 1.6.29 [%RDATE%]
*
* Read a PNG and write it out in a fixed format, using the 'simplified API' * Read a PNG and write it out in a fixed format, using the 'simplified API'
* that was introduced in libpng-1.6.0. * that was introduced in libpng-1.6.0.
* *
@@ -59,26 +61,27 @@ int main(int argc, const char **argv)
else else
fprintf(stderr, "pngtopng: write %s: %s\n", argv[2], fprintf(stderr, "pngtopng: write %s: %s\n", argv[2],
image.message); image.message);
free(buffer);
} }
else else
{
fprintf(stderr, "pngtopng: read %s: %s\n", argv[1], fprintf(stderr, "pngtopng: read %s: %s\n", argv[1],
image.message); image.message);
/* This is the only place where a 'free' is required; libpng does free(buffer);
* the cleanup on error and success, but in this case we couldn't
* complete the read because of running out of memory.
*/
png_image_free(&image);
}
} }
else else
{
fprintf(stderr, "pngtopng: out of memory: %lu bytes\n", fprintf(stderr, "pngtopng: out of memory: %lu bytes\n",
(unsigned long)PNG_IMAGE_SIZE(image)); (unsigned long)PNG_IMAGE_SIZE(image));
/* This is the only place where a 'free' is required; libpng does
* the cleanup on error and success, but in this case we couldn't
* complete the read because of running out of memory and so libpng
* has not got to the point where it can do cleanup.
*/
png_image_free(&image);
}
} }
else else

View File

@@ -55,7 +55,7 @@ mation and links to the latest version of the source code, and Chapters
13-15 of the book for detailed discussion of the three programs. 13-15 of the book for detailed discussion of the three programs.
Greg Roelofs Greg Roelofs
http://pobox.com/~newt/greg_contact.html https://pobox.com/~newt/greg_contact.html
16 March 2008 16 March 2008
@@ -63,7 +63,7 @@ BUILD INSTRUCTIONS
- Prerequisites (in order of compilation): - Prerequisites (in order of compilation):
- zlib http://zlib.net/ - zlib https://zlib.net/
- libpng http://www.libpng.org/pub/png/libpng.html - libpng http://www.libpng.org/pub/png/libpng.html
- pngbook http://www.libpng.org/pub/png/book/sources.html - pngbook http://www.libpng.org/pub/png/book/sources.html

View File

@@ -1,9 +1,8 @@
/*- /*-
* pngstest.c * pngstest.c
* *
* Copyright (c) 2013-2016 John Cunningham Bowler * Last changed in libpng 1.6.31 [July 27, 2017]
* * Copyright (c) 2013-2017 John Cunningham Bowler
* Last changed in libpng 1.6.24 [August 4, 2016]
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * 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); const unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
int alpha_added, alpha_removed; int alpha_added, alpha_removed;
int bchannels; int bchannels;
int btoa[4];
png_uint_32 y; png_uint_32 y;
Transform tr; Transform tr;
int btoa[4]={0,0,0,0};
/* This should never happen: */ /* This should never happen: */
if (width != b->image.width || height != b->image.height) 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) 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, /* Check the original image first,
* TODO: deal with input images with bad pixel values? * TODO: deal with input images with bad pixel values?
*/ */
if (amax >= a->image.colormap_entries) if (amax >= a->image.colormap_entries)
{ {
char pindex[9]; char pindex[3+2*BYTE_CHARS];
sprintf(pindex, "%d[%lu]", amax, sprintf(pindex, "%d[%u]", amax,
(unsigned long)a->image.colormap_entries); (png_byte)/*SAFE*/a->image.colormap_entries);
return logerror(a, a->file_name, ": bad pixel index: ", pindex); return logerror(a, a->file_name, ": bad pixel index: ", pindex);
} }
else if (bmax >= b->image.colormap_entries) else if (bmax >= b->image.colormap_entries)
{ {
char pindex[9]; char pindex[3+2*BYTE_CHARS];
sprintf(pindex, "%d[%lu]", bmax, sprintf(pindex, "%d[%u]", bmax,
(unsigned long)b->image.colormap_entries); (png_byte)/*SAFE*/b->image.colormap_entries);
return logerror(b, b->file_name, ": bad pixel index: ", pindex); 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: case 4:
if (pua[btoa[3]] != pub[3]) break; if (pua[btoa[3]] != pub[3]) break;
/* FALLTHROUGH */
case 3: case 3:
if (pua[btoa[2]] != pub[2]) break; if (pua[btoa[2]] != pub[2]) break;
/* FALLTHROUGH */
case 2: case 2:
if (pua[btoa[1]] != pub[1]) break; if (pua[btoa[1]] != pub[1]) break;
/* FALLTHROUGH */
case 1: case 1:
if (pua[btoa[0]] != pub[0]) break; if (pua[btoa[0]] != pub[0]) break;
if (alpha_added != 4 && pub[alpha_added] != 65535) 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: case 4:
if (psa[btoa[3]] != psb[3]) break; if (psa[btoa[3]] != psb[3]) break;
/* FALLTHROUGH */
case 3: case 3:
if (psa[btoa[2]] != psb[2]) break; if (psa[btoa[2]] != psb[2]) break;
/* FALLTHROUGH */
case 2: case 2:
if (psa[btoa[1]] != psb[1]) break; if (psa[btoa[1]] != psb[1]) break;
/* FALLTHROUGH */
case 1: case 1:
if (psa[btoa[0]] != psb[0]) break; if (psa[btoa[0]] != psb[0]) break;
if (alpha_added != 4 && psb[alpha_added] != 255) break; if (alpha_added != 4 && psb[alpha_added] != 255) break;

View File

@@ -1,8 +1,12 @@
/* /*
* png2pnm.c --- conversion from PNG-file to PGM/PPM-file * png2pnm.c --- conversion from PNG-file to PGM/PPM-file
* copyright (C) 1999 by Willem van Schaik <willem@schaik.com> * copyright (C) 1999,2017 by Willem van Schaik <willem at schaik.com>
* *
* version 1.0 - 1999.10.15 - First version. * version 1.0 - 1999.10.15 - First version.
* 1.1 - 2017.04.22 - Add buffer-size check (Glenn Randers-Pehrson)
* 1.2 - 2017.08.24 - Fix potential overflow in buffer-size check
* (Glenn Randers-Pehrson)
* 1.3 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
* *
* Permission to use, copy, modify, and distribute this software and * Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted, * its documentation for any purpose and without fee is hereby granted,
@@ -41,6 +45,7 @@
#define PNG_DEBUG 0 #define PNG_DEBUG 0
#endif #endif
#include "png.h" #include "png.h"
/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ /* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
@@ -48,11 +53,20 @@
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif #endif
#ifndef PNGMINUS_UNUSED
/* Unused formal parameter warnings are silenced using the following macro
* which is expected to have no bad effects on performance (optimizing
* compilers will probably remove it entirely).
*/
# define PNGMINUS_UNUSED(param) (void)param
#endif
/* function prototypes */ /* function prototypes */
int main (int argc, char *argv[]); int main (int argc, char *argv[]);
void usage (); void usage ();
BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha); BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw,
BOOL alpha);
/* /*
* main * main
@@ -85,7 +99,8 @@ int main(int argc, char *argv[])
if ((fp_al = fopen (argv[argi], "wb")) == NULL) if ((fp_al = fopen (argv[argi], "wb")) == NULL)
{ {
fprintf (stderr, "PNM2PNG\n"); fprintf (stderr, "PNM2PNG\n");
fprintf (stderr, "Error: can not create alpha-channel file %s\n", argv[argi]); fprintf (stderr, "Error: can not create alpha-channel file %s\n",
argv[argi]);
exit (1); exit (1);
} }
break; break;
@@ -176,9 +191,11 @@ void usage()
fprintf (stderr, "Usage: png2pnm [options] <file>.png [<file>.pnm]\n"); fprintf (stderr, "Usage: png2pnm [options] <file>.png [<file>.pnm]\n");
fprintf (stderr, " or: ... | png2pnm [options]\n"); fprintf (stderr, " or: ... | png2pnm [options]\n");
fprintf (stderr, "Options:\n"); fprintf (stderr, "Options:\n");
fprintf (stderr, " -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n"); fprintf (stderr,
" -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n");
fprintf (stderr, " -n[oraw] write pnm-file in ascii format (P1/P2/P3)\n"); fprintf (stderr, " -n[oraw] write pnm-file in ascii format (P1/P2/P3)\n");
fprintf (stderr, " -a[lpha] <file>.pgm write PNG alpha channel as pgm-file\n"); fprintf (stderr,
" -a[lpha] <file>.pgm write PNG alpha channel as pgm-file\n");
fprintf (stderr, " -h | -? print this help-information\n"); fprintf (stderr, " -h | -? print this help-information\n");
} }
@@ -186,7 +203,8 @@ void usage()
* png2pnm * png2pnm
*/ */
BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha) BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file,
volatile BOOL raw, BOOL alpha)
{ {
png_struct *png_ptr = NULL; png_struct *png_ptr = NULL;
png_info *info_ptr = NULL; png_info *info_ptr = NULL;
@@ -218,7 +236,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
/* create png and info structures */ /* create png and info structures */
png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, png_ptr = png_create_read_struct (png_get_libpng_ver(NULL),
NULL, NULL, NULL); NULL, NULL, NULL);
if (!png_ptr) if (!png_ptr)
return FALSE; /* out of memory */ return FALSE; /* out of memory */
@@ -261,7 +279,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
png_set_expand (png_ptr); png_set_expand (png_ptr);
#ifdef NJET #ifdef NJET
/* downgrade 16-bit images to 8 bit */ /* downgrade 16-bit images to 8-bit */
if (bit_depth == 16) if (bit_depth == 16)
png_set_strip_16 (png_ptr); png_set_strip_16 (png_ptr);
/* transform grayscale images into full-color */ /* transform grayscale images into full-color */
@@ -315,12 +333,21 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
/* row_bytes is the width x number of channels x (bit-depth / 8) */ /* row_bytes is the width x number of channels x (bit-depth / 8) */
row_bytes = png_get_rowbytes (png_ptr, info_ptr); row_bytes = png_get_rowbytes (png_ptr, info_ptr);
if ((png_pixels = (png_byte *) malloc (row_bytes * height * sizeof (png_byte))) == NULL) { if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
{
/* too big */
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return FALSE;
}
if ((png_pixels = (png_byte *)
malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
{
png_destroy_read_struct (&png_ptr, &info_ptr, NULL); png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
return FALSE; return FALSE;
} }
if ((row_pointers = (png_byte **) malloc (height * sizeof (png_bytep))) == NULL) if ((row_pointers = (png_byte **)
malloc ((size_t)height * sizeof (png_bytep))) == NULL)
{ {
png_destroy_read_struct (&png_ptr, &info_ptr, NULL); png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
free (png_pixels); free (png_pixels);
@@ -329,7 +356,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
} }
/* set the individual row_pointers to point at the correct offsets */ /* set the individual row_pointers to point at the correct offsets */
for (i = 0; i < (height); i++) for (i = 0; i < ((int) height); i++)
row_pointers[i] = png_pixels + i * row_bytes; row_pointers[i] = png_pixels + i * row_bytes;
/* now we can go ahead and just read the whole image */ /* now we can go ahead and just read the whole image */
@@ -372,9 +399,9 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
/* write data to PNM file */ /* write data to PNM file */
pix_ptr = png_pixels; pix_ptr = png_pixels;
for (row = 0; row < height; row++) for (row = 0; row < (int) height; row++)
{ {
for (col = 0; col < width; col++) for (col = 0; col < (int) width; col++)
{ {
for (i = 0; i < (channels - alpha_present); i++) for (i = 0; i < (channels - alpha_present); i++)
{ {
@@ -401,7 +428,8 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
if (raw) if (raw)
fputc ((int) *pix_ptr++ , alpha_file); fputc ((int) *pix_ptr++ , alpha_file);
else else
if (bit_depth == 16){ if (bit_depth == 16)
{
dep_16 = (long) *pix_ptr++; dep_16 = (long) *pix_ptr++;
fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++); fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
} }
@@ -425,6 +453,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
if (png_pixels != (unsigned char*) NULL) if (png_pixels != (unsigned char*) NULL)
free (png_pixels); free (png_pixels);
PNGMINUS_UNUSED(raw); /* to quiet a Coverity defect */
return TRUE; return TRUE;
} /* end of source */ } /* end of source */

View File

@@ -1,9 +1,13 @@
/* /*
* pnm2png.c --- conversion from PBM/PGM/PPM-file to PNG-file * pnm2png.c --- conversion from PBM/PGM/PPM-file to PNG-file
* copyright (C) 1999,2015 by Willem van Schaik <willem@schaik.com> * copyright (C) 1999,2015,2017 by Willem van Schaik <willem at schaik.com>
* *
* version 1.0 - 1999.10.15 - First version. * version 1.0 - 1999.10.15 - First version.
* version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson) * version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson)
* version 1.2 - 2017.04.22 - Add buffer-size check
* 1.3 - 2017.08.24 - Fix potential overflow in buffer-size check
* (Glenn Randers-Pehrson)
* 1.4 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
* *
* Permission to use, copy, modify, and distribute this software and * Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted, * its documentation for any purpose and without fee is hereby granted,
@@ -47,6 +51,15 @@
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif #endif
#ifndef PNGMINUS_UNUSED
/* Unused formal parameter warnings are silenced using the following macro
* which is expected to have no bad effects on performance (optimizing
* compilers will probably remove it entirely).
*/
# define PNGMINUS_UNUSED(param) (void)param
#endif
/* function prototypes */ /* function prototypes */
int main (int argc, char *argv[]); int main (int argc, char *argv[]);
@@ -370,11 +383,16 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
row_bytes = (width * channels * bit_depth + 7) / 8; row_bytes = (width * channels * bit_depth + 7) / 8;
else else
#endif #endif
/* row_bytes is the width x number of channels x (bit-depth / 8) */ /* row_bytes is the width x number of channels x (bit-depth / 8) */
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2); row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
{
/* too big */
return FALSE;
}
if ((png_pixels = (png_byte *) if ((png_pixels = (png_byte *)
malloc (row_bytes * height * sizeof (png_byte))) == NULL) malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
return FALSE; return FALSE;
/* read data from PNM file */ /* read data from PNM file */
@@ -383,7 +401,8 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
for (row = 0; row < (int) height; row++) for (row = 0; row < (int) height; row++)
{ {
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) #if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
if (packed_bitmap) { if (packed_bitmap)
{
for (i = 0; i < (int) row_bytes; i++) for (i = 0; i < (int) row_bytes; i++)
/* png supports this format natively so no conversion is needed */ /* png supports this format natively so no conversion is needed */
*pix_ptr++ = get_data (pnm_file, 8); *pix_ptr++ = get_data (pnm_file, 8);
@@ -504,6 +523,8 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
if (png_pixels != (unsigned char*) NULL) if (png_pixels != (unsigned char*) NULL)
free (png_pixels); free (png_pixels);
PNGMINUS_UNUSED(raw); /* Quiet a Coverity defect */
return TRUE; return TRUE;
} /* end of pnm2png */ } /* end of pnm2png */
@@ -520,7 +541,8 @@ void get_token(FILE *pnm_file, char *token)
do do
{ {
ret = fgetc(pnm_file); ret = fgetc(pnm_file);
if (ret == '#') { if (ret == '#')
{
/* the rest of this line is a comment */ /* the rest of this line is a comment */
do do
{ {

View File

@@ -14,7 +14,7 @@
* All routines take and return a floating point value in the range * All routines take and return a floating point value in the range
* 0 to 1.0, doing a calculation according to the sRGB specification * 0 to 1.0, doing a calculation according to the sRGB specification
* (in fact the source of the numbers is the wikipedia article at * (in fact the source of the numbers is the wikipedia article at
* http://en.wikipedia.org/wiki/SRGB). * https://en.wikipedia.org/wiki/SRGB).
*/ */
static double static double
sRGB_from_linear(double l) sRGB_from_linear(double l)

View File

@@ -1,9 +1,9 @@
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.7.0beta86 - December 29, 2016 libpng version 1.7.0beta90 - August 28, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer For conditions of distribution and use, see the disclaimer
@@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.7.0beta86 - December 29, 2016 libpng versions 0.97, January 1998, through 1.7.0beta90 - August 28, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -67,17 +67,17 @@ file format in application programs.
The PNG specification (second edition), November 2003, is available as The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
<http://www.w3.org/TR/2003/REC-PNG-20031110/ <https://www.w3.org/TR/2003/REC-PNG-20031110/
The W3C and ISO documents have identical technical content. The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at The PNG-1.2 specification is available at
<http://png-mng.sourceforge.net/pub/png/spec/1.2/>. <https://png-mng.sourceforge.io/pub/png/spec/1.2/>.
It is technically equivalent It is technically equivalent
to the PNG specification (second edition) but has some additional material. to the PNG specification (second edition) but has some additional material.
The PNG-1.0 specification is available as RFC 2083 The PNG-1.0 specification is available as RFC 2083
<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a <https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
W3C Recommendation <http://www.w3.org/TR/REC-png-961001>. W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/spec/register/> documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -102,7 +102,7 @@ majority of the needs of its users.
Libpng uses zlib for its compression and decompression of PNG files. Libpng uses zlib for its compression and decompression of PNG files.
Further information about zlib, and the latest version of zlib, can Further information about zlib, and the latest version of zlib, can
be found at the zlib home page, <http://zlib.net/>. be found at the zlib home page, <https://zlib.net/>.
The zlib compression utility is a general purpose utility that is The zlib compression utility is a general purpose utility that is
useful for more than PNG files, and can be used without libpng. useful for more than PNG files, and can be used without libpng.
See the documentation delivered with zlib for more details. See the documentation delivered with zlib for more details.
@@ -3837,7 +3837,7 @@ The #defines to be used in png_image::format. Each #define identifies a
particular layout of channel data and, if present, alpha values. There are particular layout of channel data and, if present, alpha values. There are
separate defines for each of the two channel encodings. separate defines for each of the two channel encodings.
A format is built up using single bit flag values. Not all combinations are A format is built up using one-bit flag values. Not all combinations are
valid: use the bit flag values below for testing a format returned by the valid: use the bit flag values below for testing a format returned by the
read APIs, but set formats from the derived values. read APIs, but set formats from the derived values.
@@ -4050,7 +4050,7 @@ READ APIs
When the simplified API needs to convert between sRGB and linear colorspaces, When the simplified API needs to convert between sRGB and linear colorspaces,
the actual sRGB transfer curve defined in the sRGB specification (see the the actual sRGB transfer curve defined in the sRGB specification (see the
article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
approximation used elsewhere in libpng. approximation used elsewhere in libpng.
WRITE APIS WRITE APIS
@@ -4227,7 +4227,7 @@ However, there are some uncertainties about the status of local variables
after a longjmp, so the user may want to be careful about doing anything after a longjmp, so the user may want to be careful about doing anything
after setjmp returns non-zero besides returning itself. Consult your after setjmp returns non-zero besides returning itself. Consult your
compiler documentation for more details. For an alternative approach, you compiler documentation for more details. For an alternative approach, you
may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net), may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/),
which is illustrated in pngvalid.c and in contrib/visupng. which is illustrated in pngvalid.c and in contrib/visupng.
Beginning in libpng-1.4.0, the png_set_benign_errors() API became available. Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
@@ -4447,7 +4447,7 @@ in a MNG datastream. As a minimum, it must have the MNG 8-byte signature
and the MHDR and MEND chunks. Libpng does not provide support for these and the MHDR and MEND chunks. Libpng does not provide support for these
or any other MNG chunks; your application must provide its own support for or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at them. You may wish to consider using libmng (available at
http://www.libmng.com) instead. https://www.libmng.com/) instead.
VIII. Changes to Libpng from version 0.88 VIII. Changes to Libpng from version 0.88
@@ -5189,27 +5189,33 @@ 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) going back to version 0.70. You can access the git repository (read only)
at at
git://git.code.sf.net/p/libpng/code 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 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 png-mng-implement at lists.sourceforge.net or you can upload them to
the libpng bug tracker at the libpng bug tracker at
http://libpng.sourceforge.net 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 We also accept patches built from the tar or zip distributions, and
simple verbal discriptions of bug fixes, reported either to the simple verbal discriptions of bug fixes, reported either to the
SourceForge bug tracker, to the png-mng-implement at lists.sf.net 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 XVI. Coding style
Our coding style is similar to the "Allman" style Our coding style is similar to the "Allman" style
(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly (See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
braces on separate lines: braces on separate lines:
if (condition) if (condition)
@@ -5323,7 +5329,7 @@ Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as
though it were a function. though it were a function.
Control keywords if, for, while, and switch are always followed by a space Control keywords if, for, while, and switch are always followed by a space
to distinguish them from function calls, which have no trailing space. to distinguish them from function calls, which have no trailing space.
We put a space after each comma and after each semicolon We put a space after each comma and after each semicolon
in "for" statements, and we put spaces before and after each in "for" statements, and we put spaces before and after each
@@ -5347,7 +5353,7 @@ for a few type names that we inherit from zlib.h.
We prefer "if (something != 0)" and "if (something == 0)" over We prefer "if (something != 0)" and "if (something == 0)" over
"if (something)" and if "(!something)", respectively, and for pointers "if (something)" and if "(!something)", respectively, and for pointers
we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)". we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
We do not use the TAB character for indentation in the C sources. We do not use the TAB character for indentation in the C sources.
@@ -5361,7 +5367,7 @@ 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.7.0beta86 are Y2K compliant. It is my belief that earlier upward through 1.7.0beta90 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer

113
libpng.3
View File

@@ -1,6 +1,6 @@
.TH LIBPNG 3 "December 29, 2016" .TH LIBPNG 3 "August 28, 2017"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta86 libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta90
.SH SYNOPSIS .SH SYNOPSIS
\fB \fB
#include <png.h>\fP #include <png.h>\fP
@@ -500,10 +500,10 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.7.0beta86 - December 29, 2016 libpng version 1.7.0beta90 - August 28, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2017 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer For conditions of distribution and use, see the disclaimer
@@ -511,7 +511,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.7.0beta86 - December 29, 2016 libpng versions 0.97, January 1998, through 1.7.0beta90 - August 28, 2017
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -567,17 +567,17 @@ file format in application programs.
The PNG specification (second edition), November 2003, is available as The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
<http://www.w3.org/TR/2003/REC-PNG-20031110/ <https://www.w3.org/TR/2003/REC-PNG-20031110/
The W3C and ISO documents have identical technical content. The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at The PNG-1.2 specification is available at
<http://png-mng.sourceforge.net/pub/png/spec/1.2/>. <https://png-mng.sourceforge.io/pub/png/spec/1.2/>.
It is technically equivalent It is technically equivalent
to the PNG specification (second edition) but has some additional material. to the PNG specification (second edition) but has some additional material.
The PNG-1.0 specification is available as RFC 2083 The PNG-1.0 specification is available as RFC 2083
<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a <https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
W3C Recommendation <http://www.w3.org/TR/REC-png-961001>. W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
Some additional chunks are described in the special-purpose public chunks Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/spec/register/> documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -602,7 +602,7 @@ majority of the needs of its users.
Libpng uses zlib for its compression and decompression of PNG files. Libpng uses zlib for its compression and decompression of PNG files.
Further information about zlib, and the latest version of zlib, can Further information about zlib, and the latest version of zlib, can
be found at the zlib home page, <http://zlib.net/>. be found at the zlib home page, <https://zlib.net/>.
The zlib compression utility is a general purpose utility that is The zlib compression utility is a general purpose utility that is
useful for more than PNG files, and can be used without libpng. useful for more than PNG files, and can be used without libpng.
See the documentation delivered with zlib for more details. See the documentation delivered with zlib for more details.
@@ -4337,7 +4337,7 @@ The #defines to be used in png_image::format. Each #define identifies a
particular layout of channel data and, if present, alpha values. There are particular layout of channel data and, if present, alpha values. There are
separate defines for each of the two channel encodings. separate defines for each of the two channel encodings.
A format is built up using single bit flag values. Not all combinations are A format is built up using one-bit flag values. Not all combinations are
valid: use the bit flag values below for testing a format returned by the valid: use the bit flag values below for testing a format returned by the
read APIs, but set formats from the derived values. read APIs, but set formats from the derived values.
@@ -4550,7 +4550,7 @@ READ APIs
When the simplified API needs to convert between sRGB and linear colorspaces, When the simplified API needs to convert between sRGB and linear colorspaces,
the actual sRGB transfer curve defined in the sRGB specification (see the the actual sRGB transfer curve defined in the sRGB specification (see the
article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
approximation used elsewhere in libpng. approximation used elsewhere in libpng.
WRITE APIS WRITE APIS
@@ -4727,7 +4727,7 @@ However, there are some uncertainties about the status of local variables
after a longjmp, so the user may want to be careful about doing anything after a longjmp, so the user may want to be careful about doing anything
after setjmp returns non-zero besides returning itself. Consult your after setjmp returns non-zero besides returning itself. Consult your
compiler documentation for more details. For an alternative approach, you compiler documentation for more details. For an alternative approach, you
may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net), may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/),
which is illustrated in pngvalid.c and in contrib/visupng. which is illustrated in pngvalid.c and in contrib/visupng.
Beginning in libpng-1.4.0, the png_set_benign_errors() API became available. Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
@@ -4947,7 +4947,7 @@ in a MNG datastream. As a minimum, it must have the MNG 8-byte signature
and the MHDR and MEND chunks. Libpng does not provide support for these and the MHDR and MEND chunks. Libpng does not provide support for these
or any other MNG chunks; your application must provide its own support for or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at them. You may wish to consider using libmng (available at
http://www.libmng.com) instead. https://www.libmng.com/) instead.
.SH VIII. Changes to Libpng from version 0.88 .SH VIII. Changes to Libpng from version 0.88
@@ -5689,27 +5689,33 @@ 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) going back to version 0.70. You can access the git repository (read only)
at at
git://git.code.sf.net/p/libpng/code 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 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 png-mng-implement at lists.sourceforge.net or you can upload them to
the libpng bug tracker at the libpng bug tracker at
http://libpng.sourceforge.net 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 We also accept patches built from the tar or zip distributions, and
simple verbal discriptions of bug fixes, reported either to the simple verbal discriptions of bug fixes, reported either to the
SourceForge bug tracker, to the png-mng-implement at lists.sf.net 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 .SH XVI. Coding style
Our coding style is similar to the "Allman" style Our coding style is similar to the "Allman" style
(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly (See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
braces on separate lines: braces on separate lines:
if (condition) if (condition)
@@ -5823,7 +5829,7 @@ Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as
though it were a function. though it were a function.
Control keywords if, for, while, and switch are always followed by a space Control keywords if, for, while, and switch are always followed by a space
to distinguish them from function calls, which have no trailing space. to distinguish them from function calls, which have no trailing space.
We put a space after each comma and after each semicolon We put a space after each comma and after each semicolon
in "for" statements, and we put spaces before and after each in "for" statements, and we put spaces before and after each
@@ -5847,7 +5853,7 @@ for a few type names that we inherit from zlib.h.
We prefer "if (something != 0)" and "if (something == 0)" over We prefer "if (something != 0)" and "if (something == 0)" over
"if (something)" and if "(!something)", respectively, and for pointers "if (something)" and if "(!something)", respectively, and for pointers
we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)". we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
We do not use the TAB character for indentation in the C sources. We do not use the TAB character for indentation in the C sources.
@@ -5861,7 +5867,7 @@ 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.7.0beta86 are Y2K compliant. It is my belief that earlier upward through 1.7.0beta90 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -5958,14 +5964,13 @@ the first widely used release:
... ...
1.0.19 10 10019 10.so.0.19[.0] 1.0.19 10 10019 10.so.0.19[.0]
... ...
1.2.56 13 10253 12.so.0.53[.0] 1.2.57 13 10257 12.so.0.56[.0]
... ...
1.5.27 15 10523 15.so.15.23[.0] 1.5.28 15 10528 15.so.15.28[.0]
...
1.6.22 16 10622 16.so.16.22[.0]
... ...
1.6.28 16 10628 16.so.16.28[.0]
1.7.0alpha01-10 17 10700 17.so.17.0[.0] 1.7.0alpha01-10 17 10700 17.so.17.0[.0]
1.7.0beta01-84 17 10700 17.so.17.0[.0] 1.7.0beta01-86 17 10700 17.so.17.0[.0]
Henceforth the source version will match the shared-library minor Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be and patch numbers; the shared-library major version number will be
@@ -5982,7 +5987,7 @@ release number plus "betaNN" or "rcNN".
.LP .LP
.IR libpng : .IR libpng :
.IP .IP
http://libpng.sourceforge.net (follow the [DOWNLOAD] link) https://libpng.sourceforge.io/ (follow the [DOWNLOAD] link)
http://www.libpng.org/pub/png http://www.libpng.org/pub/png
.LP .LP
@@ -5992,7 +5997,7 @@ http://www.libpng.org/pub/png
.I libpng .I libpng
or at or at
.br .br
ftp://ftp.info-zip.org/pub/infozip/zlib https://zlib.net/
.LP .LP
.IR PNG specification: RFC 2083 .IR PNG specification: RFC 2083
@@ -6001,11 +6006,11 @@ ftp://ftp.info-zip.org/pub/infozip/zlib
.I libpng .I libpng
or at or at
.br .br
ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt https://www.ietf.org/rfc/rfc2083.txt
.br .br
or (as a W3C Recommendation) at or (as a W3C Recommendation) at
.br .br
http://www.w3.org/TR/REC-png.html https://www.w3.org/TR/REC-png.html
.LP .LP
In the case of any inconsistency between the PNG specification In the case of any inconsistency between the PNG specification
@@ -6021,7 +6026,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation. Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.7.0beta86 - December 29, 2016: Libpng version 1.7.0beta90 - August 28, 2017:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -6046,8 +6051,8 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000, through 1.7.0beta86, December 29, 2016, are libpng versions 1.0.7, July 1, 2000 through 1.7.0beta90, August 28, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, 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 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 disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors: added to the list of Contributing Authors:
@@ -6068,6 +6073,10 @@ and with the following additions to the disclaimer:
risk of satisfactory quality, performance, accuracy, and effort is with risk of satisfactory quality, performance, accuracy, and effort is with
the user. the user.
Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and libpng-0.96, and are distributed according to the same disclaimer and
@@ -6091,6 +6100,9 @@ Contributing Authors:
Greg Roelofs Greg Roelofs
Tom Tanner Tom Tanner
Some files in the "scripts" directory have other copyright owners
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -6131,6 +6143,29 @@ appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
TRADEMARK:
The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
OSI CERTIFICATION:
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL:
The Copyright owner believes that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
A "png_get_copyright" function is available, for convenient use in "about" A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like: boxes and the like:
@@ -6139,13 +6174,9 @@ boxes and the like:
Also, the PNG logo (in PNG format, of course) is supplied in the Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
December 29, 2016 August 28, 2017
.\" end of man page .\" end of man page

View File

@@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "December 29, 2016" .TH LIBPNGPF 3 "August 28, 2017"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta86 libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta90
(private functions) (private functions)
.SH SYNOPSIS .SH SYNOPSIS
\fB#include \fI"pngpriv.h" \fB#include \fI"pngpriv.h"

10
png.5
View File

@@ -1,4 +1,4 @@
.TH PNG 5 "December 29, 2016" .TH PNG 5 "August 28, 2017"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION
@@ -23,12 +23,12 @@ platforms.
PNG specification (second edition), November 2003: PNG specification (second edition), November 2003:
.IP .IP
.br .br
<http://www.w3.org/TR/2003/REC-PNG-20031110/ <https://www.w3.org/TR/2003/REC-PNG-20031110/
.LP .LP
PNG 1.2 specification, July 1999: PNG 1.2 specification, July 1999:
.IP .IP
.br .br
http://png-mng.sourceforge.net/pub/png/spec/1.2/ https://png-mng.sourceforge.io/pub/png/spec/1.2/
.LP .LP
PNG 1.0 specification, October 1996: PNG 1.0 specification, October 1996:
.IP .IP
@@ -36,11 +36,11 @@ PNG 1.0 specification, October 1996:
RFC 2083 RFC 2083
.IP .IP
.br .br
http://www.ietf.org/rfc/rfc2083.txt https://www.ietf.org/rfc/rfc2083.txt
.br .br
or (as a W3C Recommendation) at or (as a W3C Recommendation) at
.br .br
http://www.w3.org/TR/REC-png-961001 https://www.w3.org/TR/REC-png-961001
.SH AUTHORS .SH AUTHORS
This man page: Glenn Randers-Pehrson This man page: Glenn Randers-Pehrson
.LP .LP

40
png.c
View File

@@ -2,7 +2,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* Last changed in libpng 1.7.0 [(PENDING RELEASE)] * Last changed in libpng 1.7.0 [(PENDING RELEASE)]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 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.)
* *
@@ -15,7 +15,7 @@
#define PNG_SRC_FILE PNG_SRC_FILE_png #define PNG_SRC_FILE PNG_SRC_FILE_png
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_7_0beta86 Your_png_h_is_not_version_1_7_0beta86; typedef png_libpng_version_1_7_0beta90 Your_png_h_is_not_version_1_7_0beta90;
/* Tells libpng that we have already handled the first "num_bytes" bytes /* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another * of the PNG file signature. If the PNG data is embedded into another
@@ -705,15 +705,15 @@ png_get_copyright(png_const_structrp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.7.0beta86 - December 29, 2016" PNG_STRING_NEWLINE \ "libpng version 1.7.0beta90 - August 28, 2017" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \ PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.7.0beta86 - December 29, 2016\ return "libpng version 1.7.0beta90 - August 28, 2017\
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif # endif
@@ -2791,7 +2791,7 @@ png_pow10(int power)
if (power < 0) if (power < 0)
{ {
if (power < DBL_MIN_10_EXP) return 0; if (power < DBL_MIN_10_EXP) return 0;
recip = 1, power = -power; recip = 1; power = -power;
} }
if (power > 0) if (power > 0)
@@ -2869,7 +2869,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double test = png_pow10(exp_b10+1); double test = png_pow10(exp_b10+1);
if (test <= DBL_MAX) if (test <= DBL_MAX)
++exp_b10, base = test; {
++exp_b10; base = test;
}
else else
break; break;
@@ -2883,7 +2885,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* test on DBL_MAX above. * test on DBL_MAX above.
*/ */
fp /= base; fp /= base;
while (fp >= 1) fp /= 10, ++exp_b10; while (fp >= 1)
{
fp /= 10; ++exp_b10;
}
/* Because of the code above fp may, at this point, be /* Because of the code above fp may, at this point, be
* less than .1, this is ok because the code below can * less than .1, this is ok because the code below can
@@ -2934,7 +2939,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Rounding up to 10, handle that here. */ /* Rounding up to 10, handle that here. */
if (czero > 0) if (czero > 0)
{ {
--czero, d = 1; --czero; d = 1;
if (cdigits == 0) --clead; if (cdigits == 0) --clead;
} }
else else
@@ -2948,7 +2953,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
else if (ch == 46) else if (ch == 46)
{ {
ch = *--ascii, ++size; ch = *--ascii; ++size;
/* Advance exp_b10 to '1', so that the /* Advance exp_b10 to '1', so that the
* decimal point happens after the * decimal point happens after the
* previous digit. * previous digit.
@@ -2975,7 +2980,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
int ch = *--ascii; int ch = *--ascii;
if (ch == 46) if (ch == 46)
++size, exp_b10 = 1; {
++size; exp_b10 = 1;
}
/* Else lost a leading zero, so 'exp_b10' is /* Else lost a leading zero, so 'exp_b10' is
* still ok at (-1) * still ok at (-1)
@@ -3066,7 +3073,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/ */
size -= cdigits; size -= cdigits;
*ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */ *ascii++ = 69; --size; /* 'E': PLUS 1 TOTAL 2+precision */
/* The following use of an unsigned temporary avoids ambiguities in /* The following use of an unsigned temporary avoids ambiguities in
* the signed arithmetic on exp_b10 and permits GCC at least to do * the signed arithmetic on exp_b10 and permits GCC at least to do
@@ -3182,7 +3189,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
* then ndigits digits to first: * then ndigits digits to first:
*/ */
i = 5; i = 5;
while (ndigits < i) *ascii++ = 48, --i; while (ndigits < i)
{
*ascii++ = 48; --i;
}
while (ndigits >= first) *ascii++ = digits[--ndigits]; while (ndigits >= first) *ascii++ = digits[--ndigits];
/* Don't output the trailing zeros! */ /* Don't output the trailing zeros! */
} }
@@ -3486,7 +3496,7 @@ png_setting(png_structrp png_ptr, png_uint_32 setting, png_uint_32 parameter,
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* sRGB conversion tables; these are machine generated with the code in /* sRGB conversion tables; these are machine generated with the code in
* contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the * contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the
* specification (see the article at http://en.wikipedia.org/wiki/SRGB) * specification (see the article at https://en.wikipedia.org/wiki/SRGB)
* is used, not the gamma=1/2.2 approximation use elsewhere in libpng. * is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
* The sRGB to linear table is exact (to the nearest 16-bit linear fraction). * The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
* The inverse (linear to sRGB) table has accuracies as follows: * The inverse (linear to sRGB) table has accuracies as follows:

62
png.h
View File

@@ -1,9 +1,9 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.7.0beta86, December 29, 2016 * libpng version 1.7.0beta90, August 28, 2017
* *
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 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.)
* *
@@ -12,7 +12,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.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.7.0beta86, December 29, 2016: * libpng versions 0.97, January 1998, through 1.7.0beta90, August 28, 2017:
* Glenn Randers-Pehrson. * Glenn Randers-Pehrson.
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
*/ */
@@ -25,8 +25,8 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.0.7, July 1, 2000, through 1.7.0beta86, December 29, 2016, are * libpng versions 1.0.7, July 1, 2000 through 1.7.0beta90, August 28, 2017 are
* Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, 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 * 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 * disclaimer and license as libpng-1.0.6 with the following individuals
* added to the list of Contributing Authors: * added to the list of Contributing Authors:
@@ -47,6 +47,10 @@
* risk of satisfactory quality, performance, accuracy, and effort is with * risk of satisfactory quality, performance, accuracy, and effort is with
* the user. * the user.
* *
* Some files in the "contrib" directory and some configure-generated
* files that are distributed with libpng have other copyright owners and
* are released under other open source licenses.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
* libpng-0.96, and are distributed according to the same disclaimer and * libpng-0.96, and are distributed according to the same disclaimer and
@@ -70,6 +74,9 @@
* Greg Roelofs * Greg Roelofs
* Tom Tanner * Tom Tanner
* *
* Some files in the "scripts" directory have other copyright owners
* but are released under this license.
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are * libpng versions 0.5, May 1995, through 0.88, January 1996, are
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
* *
@@ -109,6 +116,29 @@
* appreciated. * appreciated.
* *
* END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
*
* TRADEMARK:
*
* The name "libpng" has not been registered by the Copyright owner
* as a trademark in any jurisdiction. However, because libpng has
* been distributed and maintained world-wide, continually since 1995,
* the Copyright owner claims "common-law trademark protection" in any
* jurisdiction where common-law trademark is recognized.
*
* OSI CERTIFICATION:
*
* Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
* a certification mark of the Open Source Initiative. OSI has not addressed
* the additional disclaimers inserted at version 1.0.7.
*
* EXPORT CONTROL:
*
* The Copyright owner believes that the Export Control Classification
* Number (ECCN) for libpng is EAR99, which means not subject to export
* controls or International Traffic in Arms Regulations (ITAR) because
* it is open source, publicly available software, that does not contain
* any encryption software. See the EAR, paragraphs 734.3(b)(3) and
* 734.7(b).
*/ */
/* /*
@@ -121,12 +151,6 @@
* files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
*/ */
/*
* Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
* a certification mark of the Open Source Initiative. OSI has not addressed
* the additional disclaimers inserted at version 1.0.7.
*/
/* /*
* The contributing authors would like to thank all those who helped * The contributing authors would like to thank all those who helped
* with testing, bug fixes, and patience. This wouldn't have been * with testing, bug fixes, and patience. This wouldn't have been
@@ -210,20 +234,20 @@
* *
* See libpng.txt or libpng.3 for more information. The PNG specification * See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO Specification, * is available as a W3C Recommendation and as an ISO Specification,
* <http://www.w3.org/TR/2003/REC-PNG-20031110/ * <https://www.w3.org/TR/2003/REC-PNG-20031110/
*/ */
/* /*
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* December 29, 2016 * August 28, 2017
* *
* 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.7.0beta86 are Y2K compliant. It is my belief that * upward through 1.7.0beta90 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant. * earlier versions were also Y2K compliant.
* *
* Libpng only has two year fields. One is a 2-byte unsigned integer * Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -285,8 +309,8 @@
*/ */
/* 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.7.0beta86" #define PNG_LIBPNG_VER_STRING "1.7.0beta90"
#define PNG_HEADER_VERSION_STRING " libpng version 1.7.0beta86 - December 29, 2016\n" #define PNG_HEADER_VERSION_STRING " libpng version 1.7.0beta90 - August 28, 2017\n"
#define PNG_LIBPNG_VER_SONUM 17 #define PNG_LIBPNG_VER_SONUM 17
#define PNG_LIBPNG_VER_DLLNUM 17 #define PNG_LIBPNG_VER_DLLNUM 17
@@ -300,7 +324,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/ */
#define PNG_LIBPNG_VER_BUILD 86 #define PNG_LIBPNG_VER_BUILD 90
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@@ -560,7 +584,7 @@ extern "C" {
/* 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 char* png_libpng_version_1_7_0beta86; typedef char* png_libpng_version_1_7_0beta90;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
* *
@@ -3381,7 +3405,7 @@ typedef struct
* *
* When the simplified API needs to convert between sRGB and linear colorspaces, * When the simplified API needs to convert between sRGB and linear colorspaces,
* the actual sRGB transfer curve defined in the sRGB specification (see the * the actual sRGB transfer curve defined in the sRGB specification (see the
* article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
* approximation used elsewhere in libpng. * approximation used elsewhere in libpng.
* *
* When an alpha channel is present it is expected to denote pixel coverage * When an alpha channel is present it is expected to denote pixel coverage

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.7.0beta86, December 29, 2016 * libpng version 1.7.0beta90, August 28, 2017
* *
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@@ -743,6 +743,8 @@ png_push_read_chunk_header(png_structrp png_ptr, png_infop info_ptr)
png_ptr->chunk_length = png_get_uint_31(png_ptr, chunk_header); png_ptr->chunk_length = png_get_uint_31(png_ptr, chunk_header);
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_header+4); png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_header+4);
png_reset_crc(png_ptr, chunk_header+4); png_reset_crc(png_ptr, chunk_header+4);
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
png_check_chunk_length(png_ptr, png_ptr->chunk_length);
mode = png_ptr->mode; mode = png_ptr->mode;
png_ptr->process_mode = png_check_bits(png_ptr, png_ptr->process_mode = png_check_bits(png_ptr,
png_read_chunk+png_find_chunk_op(png_ptr), 4); png_read_chunk+png_find_chunk_op(png_ptr), 4);

View File

@@ -1737,6 +1737,12 @@ PNG_INTERNAL_FUNCTION(png_chunk_op,png_find_chunk_op,(png_structrp png_ptr),
* read state. * read state.
*/ */
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
const png_uint_32 chunk_name),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
const png_uint_32 chunk_length),PNG_EMPTY);
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
png_inforp info_ptr, png_bytep chunk_data),PNG_EMPTY); png_inforp info_ptr, png_bytep chunk_data),PNG_EMPTY);

View File

@@ -2,7 +2,7 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.7.0 [(PENDING RELEASE)] * Last changed in libpng 1.7.0 [(PENDING RELEASE)]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 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.)
* *
@@ -2198,6 +2198,9 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr)
} }
#endif /* USER_LIMITS */ #endif /* USER_LIMITS */
/* Note, "length" is sufficient here; we won't be adding
* a null terminator later.
*/
buffer = png_read_buffer(png_ptr, length, 2/*silent*/); buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
if (buffer == NULL) if (buffer == NULL)
@@ -2623,24 +2626,61 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
* ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) * ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
*/ */
static void void /* PRIVATE */
png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name) png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
{ {
int i; int i;
png_uint_32 cn=chunk_name;
png_debug(1, "in png_check_chunk_name"); png_debug(1, "in png_check_chunk_name");
for (i=1; i<=4; ++i) for (i=1; i<=4; ++i)
{ {
int c = chunk_name & 0xff; int c = cn & 0xff;
/* This is unrecoverable at present because it most likely indicates
* a broken stream.
*/
if (c < 65 || c > 122 || (c > 90 && c < 97)) if (c < 65 || c > 122 || (c > 90 && c < 97))
png_chunk_error(png_ptr, "invalid chunk type"); png_chunk_error(png_ptr, "invalid chunk type");
chunk_name >>= 8; cn >>= 8;
}
}
void /* PRIVATE */
png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
{
png_alloc_size_t limit = PNG_UINT_31_MAX;
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (png_ptr->user_chunk_malloc_max > 0 &&
png_ptr->user_chunk_malloc_max < limit)
limit = png_ptr->user_chunk_malloc_max;
# elif PNG_USER_CHUNK_MALLOC_MAX > 0
if (PNG_USER_CHUNK_MALLOC_MAX < limit)
limit = PNG_USER_CHUNK_MALLOC_MAX;
# endif
if (png_ptr->chunk_name == png_IDAT)
{
/* color_type 0 x 2 3 4 x 6 */
int channels[]={1,0,3,1,2,0,4};
png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
size_t row_factor =
(png_ptr->width * channels[png_ptr->color_type] *
(png_ptr->bit_depth > 8? 2: 1)
+ 1 + (png_ptr->interlaced? 6: 0));
if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
idat_limit=PNG_UINT_31_MAX;
else
idat_limit = png_ptr->height * row_factor;
row_factor = row_factor > 32566? 32566 : row_factor;
idat_limit += 6 + 5*(idat_limit/row_factor+1); /* zlib+deflate overhead */
idat_limit=idat_limit < PNG_UINT_31_MAX? idat_limit : PNG_UINT_31_MAX;
limit = limit < idat_limit? idat_limit : limit;
}
if (length > limit)
{
png_debug2(0," length = %lu, limit = %lu",
(unsigned long)length,(unsigned long)limit);
png_chunk_error(png_ptr, "chunk data is too large");
} }
} }
@@ -3549,7 +3589,10 @@ png_read_filter_row_paeth_1byte_pixel(png_alloc_size_t row_bytes,
/* Find the best predictor, the least of pa, pb, pc favoring the earlier /* Find the best predictor, the least of pa, pb, pc favoring the earlier
* ones in the case of a tie. * ones in the case of a tie.
*/ */
if (pb < pa) pa = pb, a = b; if (pb < pa)
{
pa = pb; a = b;
}
if (pc < pa) a = c; if (pc < pa) a = c;
/* Calculate the current pixel in a, and move the previous row pixel to c /* Calculate the current pixel in a, and move the previous row pixel to c
@@ -3594,7 +3637,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_alloc_size_t row_bytes,
pc = (p + pc) < 0 ? -(p + pc) : p + pc; pc = (p + pc) < 0 ? -(p + pc) : p + pc;
# endif # endif
if (pb < pa) pa = pb, a = b; if (pb < pa)
{
pa = pb; a = b;
}
if (pc < pa) a = c; if (pc < pa) a = c;
a = 0xFFU & (a + *row); a = 0xFFU & (a + *row);
@@ -3626,7 +3672,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_alloc_size_t row_bytes,
pc = (p + pc) < 0 ? -(p + pc) : p + pc; pc = (p + pc) < 0 ? -(p + pc) : p + pc;
# endif # endif
if (pb < pa) pa = pb, a = b; if (pb < pa)
{
pa = pb; a = b;
}
if (pc < pa) a = c; if (pc < pa) a = c;
a = 0xFFU & (a + *row); a = 0xFFU & (a + *row);
@@ -4383,7 +4432,7 @@ png_read_process_IDAT(png_structrp png_ptr, png_bytep transformed_row,
impossible("bad row state"); impossible("bad row state");
} /* forever switch */ } /* forever switch */
PNG_UNUSED(save_row); /* May not be used above */ PNG_UNUSED(save_row) /* May not be used above */
} }
void /* PRIVATE */ void /* PRIVATE */

View File

@@ -1208,8 +1208,9 @@ png_set_sPLT(png_structrp png_ptr,
info_ptr->valid |= PNG_INFO_sPLT; info_ptr->valid |= PNG_INFO_sPLT;
++(info_ptr->splt_palettes_num); ++(info_ptr->splt_palettes_num);
++np; ++np;
++entries;
} }
while (++entries, --nentries); while (--nentries);
if (nentries > 0) if (nentries > 0)
png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR); png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);

View File

@@ -2083,4 +2083,4 @@ main(void)
#endif #endif
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_7_0beta86 Your_png_h_is_not_version_1_7_0beta86; typedef png_libpng_version_1_7_0beta90 Your_png_h_is_not_version_1_7_0beta90;

View File

@@ -2697,7 +2697,7 @@ png_do_invert_all(png_transformp *transform, png_transform_controlp tc)
while (png_upcast(void*,dp) < dp_end) while (png_upcast(void*,dp) < dp_end)
*dp++ = ~*sp++; *dp++ = ~*sp++;
PNG_UNUSED(transform); PNG_UNUSED(transform)
} }
static void static void
@@ -2748,7 +2748,7 @@ png_do_invert_channel(png_transformp *transform, png_transform_controlp tc)
} }
} }
PNG_UNUSED(transform); PNG_UNUSED(transform)
} }
static void static void

View File

@@ -4894,7 +4894,7 @@ png_write_png_data(png_structrp png_ptr, png_bytep prev_pixels,
write_unfiltered_rowbits(png_ptr, unfiltered_row, row_bits, write_unfiltered_rowbits(png_ptr, unfiltered_row, row_bits,
x == 0 ? PNG_FILTER_VALUE_NONE : PNG_FILTER_VALUE_LAST, flush); x == 0 ? PNG_FILTER_VALUE_NONE : PNG_FILTER_VALUE_LAST, flush);
PNG_UNUSED(prev_pixels); PNG_UNUSED(prev_pixels)
/* Handle end of row: */ /* Handle end of row: */
if ((row_info_flags & png_row_end) != 0) if ((row_info_flags & png_row_end) != 0)

View File

@@ -126,7 +126,7 @@ $# to work, download Brian Kernighan's awk (Brian Kernighan is the author of
$# awk.) You can find source code and a built executable (called awk95.exe) $# awk.) You can find source code and a built executable (called awk95.exe)
$# here: $# here:
$# $#
$# http://www.cs.princeton.edu/~bwk/btl.mirror/ $# https://www.cs.princeton.edu/~bwk/btl.mirror/
$# $#
$# The executable works just fine. $# The executable works just fine.
$# $#

View File

@@ -1,7 +1,7 @@
VisualStudio instructions VisualStudio instructions
libpng version 1.7.0beta86 - December 29, 2016 libpng version 1.7.0beta90 - August 28, 2017
Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson

View File

@@ -2,7 +2,7 @@
<!-- <!--
* zlib.props - location of zlib source * zlib.props - location of zlib source
* *
* libpng version 1.7.0beta86 - December 29, 2016 * libpng version 1.7.0beta90 - August 28, 2017
* *
* Copyright (c) 2011,2013,2014 Glenn Randers-Pehrson * Copyright (c) 2011,2013,2014 Glenn Randers-Pehrson
* *

View File

@@ -1,9 +1,9 @@
Makefiles for libpng version 1.7.0beta86 - December 29, 2016 Makefiles for libpng version 1.7.0beta90 - August 28, 2017
pnglibconf.h.prebuilt => Stores configuration settings pnglibconf.h.prebuilt => Stores configuration settings
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng17.so.17.1.7.0beta86) (gcc, creates libpng17.so.17.1.7.0beta90)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
@@ -33,12 +33,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc, makefile.sggcc => Silicon Graphics (gcc,
creates libpng17.so.17.1.7.0beta86) creates libpng17.so.17.1.7.0beta90)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc, makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng17.so.17.1.7.0beta86) creates libpng17.so.17.1.7.0beta90)
makefile.so9 => Solaris 9 makefile (gcc, makefile.so9 => Solaris 9 makefile (gcc,
creates libpng17.so.17.1.7.0beta86) creates libpng17.so.17.1.7.0beta90)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile

View File

@@ -21,7 +21,7 @@ PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE" PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
PNG_DFN "" PNG_DFN ""
PNG_DFN "EXPORTS" PNG_DFN "EXPORTS"
PNG_DFN ";Version 1.7.0beta86" PNG_DFN ";Version 1.7.0beta90"
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\ #define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@" PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"

View File

@@ -11,7 +11,7 @@
# Modeled after libxml-config. # Modeled after libxml-config.
version=1.7.0beta86 version=1.7.0beta90
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""

View File

@@ -5,6 +5,6 @@ includedir=@includedir@/libpng17
Name: libpng Name: libpng
Description: Loads and saves PNG files Description: Loads and saves PNG files
Version: 1.7.0beta86 Version: 1.7.0beta90
Libs: -L${libdir} -lpng17 Libs: -L${libdir} -lpng17
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@@ -92,7 +92,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o: .c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config

View File

@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng17
LIB= png17 LIB= png17
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.7.0beta86 SHLIB_MINOR= 1.7.0beta90
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
LIB= png LIB= png
SHLIB_MAJOR= 17 SHLIB_MAJOR= 17
SHLIB_MINOR= 1.7.0beta86 SHLIB_MINOR= 1.7.0beta90
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 17 SHLIB_MAJOR= 17
SHLIB_MINOR= 1.7.0beta86 SHLIB_MINOR= 1.7.0beta90
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \

View File

@@ -83,7 +83,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o: .c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config

View File

@@ -1,8 +1,8 @@
/* libpng 1.7.0beta86 STANDARD API DEFINITION */ /* libpng 1.7.0beta90 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */ /* pnglibconf.h - library build configuration */
/* libpng version 1.7.0beta86, December 29, 2016 */ /* libpng version 1.7.0beta90, August 28, 2017 */
/* Copyright (c) 1998-2016 Glenn Randers-Pehrson */ /* Copyright (c) 1998-2016 Glenn Randers-Pehrson */

View File

@@ -1,4 +1,4 @@
;Version 1.7.0beta86 ;Version 1.7.0beta90
;-------------------------------------------------------------- ;--------------------------------------------------------------
; LIBPNG symbol list as a Win32 DEF file ; LIBPNG symbol list as a Win32 DEF file
; Contains all the symbols that can be exported from libpng ; Contains all the symbols that can be exported from libpng

BIN
tests/bad_iccp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

BIN
tests/huge_idat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

View File

@@ -1,4 +1,7 @@
#!/bin/sh #!/bin/sh
./pngtest --relaxed ${srcdir}/tests/badcrc.png ./pngtest --relaxed ${srcdir}/tests/badcrc.png
./pngtest --relaxed ${srcdir}/tests/badadler.png ./pngtest --relaxed ${srcdir}/tests/badadler.png
./pngtest --relaxed ${srcdir}/tests/bad_iccp.png
./pngtest --relaxed ${srcdir}/tests/huge_idat.png
./pngtest --relaxed ${srcdir}/tests/empty_ancillary_chunks.png
exec ./pngtest --strict ${srcdir}/pngtest.png exec ./pngtest --strict ${srcdir}/pngtest.png