Compare commits

...

9 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
ffb50e6516 [libpng14] Imported from libpng-1.4.15.tar 2015-02-12 11:25:07 -06:00
Glenn Randers-Pehrson
98c96c68c5 [libpng14] Imported from libpng-1.4.15rc02.tar 2015-02-06 11:58:19 -06:00
Glenn Randers-Pehrson
4743e9e892 [libpng14] Quieted more harmless warnings from Coverity-scan. 2015-02-06 11:57:17 -06:00
Glenn Randers-Pehrson
83e10a6347 [libpng14] Imported from libpng-1.4.15rc01.tar 2015-02-05 11:54:44 -06:00
Glenn Randers-Pehrson
13688096d4 [libpng14] Imported from libpng-1.4.15beta02.tar 2015-01-30 10:31:57 -06:00
Glenn Randers-Pehrson
173432da9e [lbpng14] Quieted some harmless warnings from Coverity-scan. 2015-01-30 10:26:13 -06:00
Glenn Randers-Pehrson
4df1247bd6 [libpng14] Imported from libpng-1.4.15beta01.tar 2015-01-27 07:21:43 -06:00
Glenn Randers-Pehrson
9d2252921d [libpng14] Restored test for maximum allowed image width that was removed from
libpng-1.4.13 (fixes CVE-2014-9495 and CVE-2015-0973).
2015-01-22 12:08:18 -06:00
Glenn Randers-Pehrson
baecb72555 [libpng14] Bump version to 1.4.15beta01 2015-01-22 12:03:29 -06:00
37 changed files with 243 additions and 162 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.4.14 - November 20, 2014
Libpng 1.4.15 - February 12, 2015
This is a public release of libpng, intended for use in production codes.
@@ -8,26 +8,27 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
libpng-1.4.14.tar.xz (LZMA-compressed, recommended)
libpng-1.4.14.tar.gz
libpng-1.4.14.tar.bz2
libpng-1.4.15.tar.xz (LZMA-compressed, recommended)
libpng-1.4.15.tar.gz
libpng-1.4.15.tar.bz2
Source files with CRLF line endings (for Windows), without the
"configure" script
lpng1414.7z (LZMA-compressed, recommended)
lpng1414.zip
lpng1415.7z (LZMA-compressed, recommended)
lpng1415.zip
Other information:
libpng-1.4.14-README.txt
libpng-1.4.14-LICENSE.txt
libpng-1.4.14-*.asc (armored detached GPG signatures)
libpng-1.4.15-README.txt
libpng-1.4.15-LICENSE.txt
libpng-1.4.15-*.asc (armored detached GPG signatures)
Changes since the last public release (1.4.13):
Avoid out-of-bounds memory access in png_user_version_check().
Simplified and future-proofed png_user_version_check().
Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32.
Changes since the last public release (1.4.14):
Restored test for maximum allowed image width that was removed from
libpng-1.4.13 (fixes CVE-2014-9495 and CVE-2015-0973).
Quieted some harmless warnings from Coverity-scan.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit

17
CHANGES
View File

@@ -2920,6 +2920,23 @@ version 1.4.14rc02 [November 17, 2014]
Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32
version 1.4.14 [November 20, 2014]
No changes.
version 1.4.15beta01 [January 27, 2015]
Restored test for maximum allowed image width that was removed from
libpng-1.4.13 (fixes CVE-2014-9495 and CVE-2015-0973).
version 1.4.15beta02 [January 30, 2015]
Quieted some harmless warnings from Coverity-scan.
version 1.4.15rc01 [February 5, 2015]
No changes.
version 1.4.15rc02 [February 6, 2015]
Quieted more harmless warnings from Coverity-scan.
version 1.4.15 [February 12, 2015]
No changes.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit

View File

@@ -33,7 +33,7 @@ enable_testing()
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 4)
set(PNGLIB_RELEASE 14)
set(PNGLIB_RELEASE 15)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
@@ -255,7 +255,7 @@ install(CODE ${PNG_CONFIG_INSTALL_CODE})
# SET UP LINKS
if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 14.${PNGLIB_RELEASE}.1.4.14
# VERSION 14.${PNGLIB_RELEASE}.1.4.15
VERSION 14.${PNGLIB_RELEASE}.0
SOVERSION 14
CLEAN_DIRECT_OUTPUT 1)

View File

@@ -1,5 +1,5 @@
Installing libpng version 1.4.14 - November 20, 2014
Installing libpng version 1.4.15 - February 12, 2015
On Unix/Linux and similar systems, you can simply type
@@ -46,7 +46,7 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they
might be called "libpng-1.4.14" or "libpng14" and "zlib-1.2.3"
might be called "libpng-1.4.15" or "libpng14" and "zlib-1.2.3"
or "zlib123") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:

View File

@@ -10,7 +10,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.14, November 20, 2014, are
libpng versions 1.2.6, August 15, 2004, through 1.4.15, February 12, 2015, are
Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
November 20, 2014
February 12, 2015

View File

@@ -79,7 +79,7 @@ EXTRA_DIST= \
${srcdir}/contrib/pngsuite/* \
${srcdir}/contrib/visupng/* \
$(TESTS) \
example.c libpng-1.4.14.txt
example.c libpng-1.4.15.txt
CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
libpng.sym

View File

@@ -616,7 +616,7 @@ EXTRA_DIST = \
${srcdir}/contrib/pngsuite/* \
${srcdir}/contrib/visupng/* \
$(TESTS) \
example.c libpng-1.4.14.txt
example.c libpng-1.4.15.txt
CLEANFILES = pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
libpng.sym

12
README
View File

@@ -1,4 +1,4 @@
README for libpng version 1.4.14 - November 20, 2014 (shared library 14.0)
README for libpng version 1.4.15 - February 12, 2015 (shared library 14.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@@ -187,9 +187,9 @@ Files in this distribution:
makefile.std => Generic UNIX makefile (cc, creates static
libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
@@ -211,12 +211,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc

24
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libpng 1.4.14.
# Generated by GNU Autoconf 2.69 for libpng 1.4.15.
#
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng'
PACKAGE_VERSION='1.4.14'
PACKAGE_STRING='libpng 1.4.14'
PACKAGE_VERSION='1.4.15'
PACKAGE_STRING='libpng 1.4.15'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
PACKAGE_URL=''
@@ -1330,7 +1330,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libpng 1.4.14 to adapt to many kinds of systems.
\`configure' configures libpng 1.4.15 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1400,7 +1400,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpng 1.4.14:";;
short | recursive ) echo "Configuration of libpng 1.4.15:";;
esac
cat <<\_ACEOF
@@ -1512,7 +1512,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libpng configure 1.4.14
libpng configure 1.4.15
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1935,7 +1935,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpng $as_me 1.4.14, which was
It was created by libpng $as_me 1.4.15, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2798,7 +2798,7 @@ fi
# Define the identity of the package.
PACKAGE='libpng'
VERSION='1.4.14'
VERSION='1.4.15'
cat >>confdefs.h <<_ACEOF
@@ -2914,10 +2914,10 @@ fi
PNGLIB_VERSION=1.4.14
PNGLIB_VERSION=1.4.15
PNGLIB_MAJOR=1
PNGLIB_MINOR=4
PNGLIB_RELEASE=14
PNGLIB_RELEASE=15
@@ -13119,7 +13119,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libpng $as_me 1.4.14, which was
This file was extended by libpng $as_me 1.4.15, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13185,7 +13185,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libpng config.status 1.4.14
libpng config.status 1.4.15
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@@ -16,17 +16,17 @@ dnl should not be necessary to regenerate configure if the time
dnl stamps are correct
AC_PREREQ(2.59)
AC_INIT([libpng], [1.4.14], [png-mng-implement@lists.sourceforge.net])
AC_INIT([libpng], [1.4.15], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake
AM_MAINTAINER_MODE
dnl Version number stuff here:
PNGLIB_VERSION=1.4.14
PNGLIB_VERSION=1.4.15
PNGLIB_MAJOR=1
PNGLIB_MINOR=4
PNGLIB_RELEASE=14
PNGLIB_RELEASE=15
dnl End of version number stuff

View File

@@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.4.14 - November 20, 2014
libpng version 1.4.15 - February 12, 2015
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2014 Glenn Randers-Pehrson
@@ -11,7 +11,7 @@ libpng.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.4.14 - November 20, 2014
libpng versions 0.97, January 1998, through 1.4.15 - February 12, 2015
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2014 Glenn Randers-Pehrson
@@ -906,7 +906,7 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha.
As of libpng version 1.4.14, not all possible expansions are supported.
As of libpng version 1.4.15, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means
@@ -3316,13 +3316,13 @@ Other rules can be inferred by inspecting the libpng source.
XIII. Y2K Compliance in libpng
November 20, 2014
February 12, 2015
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.4.14 are Y2K compliant. It is my belief that earlier
upward through 1.4.15 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@@ -1,6 +1,6 @@
.TH LIBPNG 3 "November 20, 2014"
.TH LIBPNG 3 "February 12, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.14
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.15
.SH SYNOPSIS
\fB
#include <png.h>\fP
@@ -442,7 +442,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng
libpng version 1.4.14 - November 20, 2014
libpng version 1.4.15 - February 12, 2015
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2014 Glenn Randers-Pehrson
@@ -453,7 +453,7 @@ libpng.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.4.14 - November 20, 2014
libpng versions 0.97, January 1998, through 1.4.15 - February 12, 2015
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2014 Glenn Randers-Pehrson
@@ -1348,7 +1348,7 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha.
As of libpng version 1.4.14, not all possible expansions are supported.
As of libpng version 1.4.15, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means
@@ -3758,13 +3758,13 @@ Other rules can be inferred by inspecting the libpng source.
.SH XIII. Y2K Compliance in libpng
November 20, 2014
February 12, 2015
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.4.14 are Y2K compliant. It is my belief that earlier
upward through 1.4.15 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that
@@ -3979,6 +3979,9 @@ the first widely used release:
1.4.14beta01 14 10414 14.so.14.14[.0]
1.4.14rc01-02 14 10414 14.so.14.14[.0]
1.4.14 14 10414 14.so.14.14[.0]
1.4.15beta01-02 14 10415 14.so.14.15[.0]
1.4.15rc01-02 14 10415 14.so.14.15[.0]
1.4.15 14 10415 14.so.14.15[.0]
Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be
@@ -4034,7 +4037,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.4.14 - November 20, 2014:
Libpng version 1.4.15 - February 12, 2015:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -4057,7 +4060,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.14, November 20, 2014, are
libpng versions 1.2.6, August 15, 2004, through 1.4.15, February 12, 2015, are
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@@ -4156,7 +4159,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
November 20, 2014
February 12, 2015
.\" end of man page

View File

@@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "November 20, 2014"
.TH LIBPNGPF 3 "February 12, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.14
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.15
(private functions)
.SH SYNOPSIS
\fB#include <png.h>

2
png.5
View File

@@ -1,4 +1,4 @@
.TH PNG 5 "November 20, 2014"
.TH PNG 5 "February 12, 2015"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

99
png.c
View File

@@ -1,8 +1,8 @@
/* png.c - location for general purpose libpng functions
*
* Last changed in libpng 1.4.6 [March 8, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -17,7 +17,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_4_14 Your_png_h_is_not_version_1_4_14;
typedef version_1_4_15 Your_png_h_is_not_version_1_4_15;
/* 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
@@ -74,12 +74,16 @@ voidpf /* PRIVATE */
png_zalloc(voidpf png_ptr, uInt items, uInt size)
{
png_voidp ptr;
png_structp p=(png_structp)png_ptr;
png_uint_32 save_flags=p->flags;
png_structp p;
png_uint_32 save_flags;
png_alloc_size_t num_bytes;
if (png_ptr == NULL)
return (NULL);
p=(png_structp)png_ptr;
save_flags=p->flags;
if (items > PNG_UINT_32_MAX/size)
{
png_warning (p, "Potential overflow in png_zalloc()");
@@ -547,14 +551,14 @@ png_get_copyright(png_const_structp png_ptr)
#else
#ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.4.14 - November 20, 2014" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"libpng version 1.4.15 - February 12, 2015" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE);
#else
return ((png_charp) "libpng version 1.4.14 - November 20, 2014\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
return ((png_charp) "libpng version 1.4.15 - February 12, 2015\
Copyright (c) 1998-2015 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
#endif
@@ -721,14 +725,14 @@ png_check_cHRM_fixed(png_structp png_ptr,
"Ignoring attempt to set negative chromaticity value");
ret = 0;
}
if (white_x > (png_fixed_point) PNG_UINT_31_MAX ||
white_y > (png_fixed_point) PNG_UINT_31_MAX ||
red_x > (png_fixed_point) PNG_UINT_31_MAX ||
red_y > (png_fixed_point) PNG_UINT_31_MAX ||
green_x > (png_fixed_point) PNG_UINT_31_MAX ||
green_y > (png_fixed_point) PNG_UINT_31_MAX ||
blue_x > (png_fixed_point) PNG_UINT_31_MAX ||
blue_y > (png_fixed_point) PNG_UINT_31_MAX )
if (white_x >= (png_fixed_point) PNG_UINT_31_MAX ||
white_y >= (png_fixed_point) PNG_UINT_31_MAX ||
red_x >= (png_fixed_point) PNG_UINT_31_MAX ||
red_y >= (png_fixed_point) PNG_UINT_31_MAX ||
green_x >= (png_fixed_point) PNG_UINT_31_MAX ||
green_y >= (png_fixed_point) PNG_UINT_31_MAX ||
blue_x >= (png_fixed_point) PNG_UINT_31_MAX ||
blue_y >= (png_fixed_point) PNG_UINT_31_MAX )
{
png_warning(png_ptr,
"Ignoring attempt to set chromaticity value exceeding 21474.83");
@@ -770,6 +774,17 @@ png_check_cHRM_fixed(png_structp png_ptr,
#endif /* PNG_CHECK_cHRM_SUPPORTED */
#endif /* PNG_cHRM_SUPPORTED */
#ifdef __GNUC__
/* This exists solely to work round a warning from GNU C. */
static int /* PRIVATE */
png_gt(size_t a, size_t b)
{
return a > b;
}
#else
# define png_gt(a,b) ((a) > (b))
#endif
void /* PRIVATE */
png_check_IHDR(png_structp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -785,9 +800,31 @@ png_check_IHDR(png_structp png_ptr,
error = 1;
}
if (height == 0)
if (width > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Image height is zero in IHDR");
png_warning(png_ptr, "Invalid image width in IHDR");
error = 1;
}
if (png_gt(((width + 7) & (~7)),
((PNG_UINT_32_MAX /* Changed to PNG_SIZE_MAX here in libpng-1.5.21 */
- 48 /* big_row_buf hack */
- 1) /* filter byte */
/ 8) /* 8-byte RGBA pixels */
- 1)) /* extra max_pixel_depth pad */
{
/* The size of the row must be within the limits of this architecture.
* Because the read code can perform arbitrary transformations the
* maximum size is checked here. Because the code in png_read_start_row
* adds extra space "for safety's sake" in several places a conservative
* limit is used here.
*
* NOTE: it would be far better to check the size that is actually used,
* but the effect in the real world is minor and the changes are more
* extensive, therefore much more dangerous and much more difficult to
* write in a way that avoids compiler warnings.
*/
png_warning(png_ptr, "Image width is too large for this architecture");
error = 1;
}
@@ -801,6 +838,18 @@ png_check_IHDR(png_structp png_ptr,
error = 1;
}
if (height == 0)
{
png_warning(png_ptr, "Image height is zero in IHDR");
error = 1;
}
if (height > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image height in IHDR");
error = 1;
}
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (height > png_ptr->user_height_max || height > PNG_USER_HEIGHT_MAX)
#else
@@ -811,18 +860,6 @@ png_check_IHDR(png_structp png_ptr,
error = 1;
}
if (width > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image width in IHDR");
error = 1;
}
if ( height > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image height in IHDR");
error = 1;
}
/* Check other values */
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
bit_depth != 8 && bit_depth != 16)

33
png.h
View File

@@ -1,8 +1,8 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.4.14 - November 20, 2014
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* libpng version 1.4.15 - February 12, 2015
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -11,7 +11,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.4.14 - November 20, 2014: Glenn
* libpng versions 0.97, January 1998, through 1.4.15 - February 12, 2015: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -176,6 +176,9 @@
* 1.4.14beta01 14 10414 14.so.14.14[.0]
* 1.4.14rc01-02 14 10414 14.so.14.14[.0]
* 1.4.14 14 10414 14.so.14.14[.0]
* 1.4.15beta01-02 14 10415 14.so.14.15[.0]
* 1.4.15rc01-02 14 10415 14.so.14.15[.0]
* 1.4.15 14 10415 14.so.14.15[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -207,7 +210,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.4.14, November 20, 2014, are
* libpng versions 1.2.6, August 15, 2004, through 1.4.15, February 12, 2015, are
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@@ -319,13 +322,13 @@
* Y2K compliance in libpng:
* =========================
*
* November 20, 2014
* February 12, 2015
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.4.14 are Y2K compliant. It is my belief that earlier
* upward through 1.4.15 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -381,9 +384,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.4.14"
#define PNG_LIBPNG_VER_STRING "1.4.15"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.4.14 - November 20, 2014\n"
" libpng version 1.4.15 - February 12, 2015\n"
#define PNG_LIBPNG_VER_SONUM 14
#define PNG_LIBPNG_VER_DLLNUM 14
@@ -391,7 +394,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 4
#define PNG_LIBPNG_VER_RELEASE 14
#define PNG_LIBPNG_VER_RELEASE 15
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
@@ -421,7 +424,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10414 /* 1.4.14 */
#define PNG_LIBPNG_VER 10415 /* 1.4.15 */
#ifndef PNG_VERSION_INFO_ONLY
/* Include the compression library's header */
@@ -1507,7 +1510,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_4_14;
typedef png_structp version_1_4_15;
typedef png_struct FAR * FAR * png_structpp;
@@ -2673,10 +2676,10 @@ PNG_EXPORT(png_bytep,png_get_io_chunk_name)
* format for negative values, which is almost certainly true.
*/
# define png_get_uint_32(buf) \
(((png_uint_32)(*(buf)) << 24) + \
((png_uint_32)(*((buf) + 1)) << 16) + \
((png_uint_32)(*((buf) + 2)) << 8) + \
((png_uint_32)(*((buf) + 3))))
(((png_uint_32)((*(buf)) & 0xff) << 24) + \
((png_uint_32)((*((buf) + 1)) & 0xff) << 16) + \
((png_uint_32)((*((buf) + 2)) & 0xff) << 8) + \
((png_uint_32)((*((buf) + 3)) & 0xff)))
/* The following definition introduces an API incompatibility (but not
* an ABI incompatibility) with libpng-1.4.0 through 1.4.4. Prior to

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.4.14 - November 20, 2014
* libpng version 1.4.15 - February 12, 2015
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@@ -1,7 +1,7 @@
/* pngpriv.h - private declarations for use inside libpng
*
* libpng version 1.4.14 - November 20, 2014
* libpng version 1.4.15 - February 12, 2015
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.4.13 [February 6, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -2370,10 +2370,14 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
for (i = 0; i < row_width; i++)
{
png_uint_16 red, green, blue, w;
png_byte hi,lo;
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
hi=*(sp)++; lo=*(sp)++;
red = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
green = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
blue = (png_uint_16)((hi << 8) | (lo));
if (red == green && red == blue)
w = red;
@@ -2405,10 +2409,14 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
for (i = 0; i < row_width; i++)
{
png_uint_16 red, green, blue, gray16;
png_byte hi,lo;
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
hi=*(sp)++; lo=*(sp)++;
red = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
green = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
blue = (png_uint_16)((hi << 8) | (lo));
if (red != green || red != blue)
rgb_error |= 1;
@@ -2468,10 +2476,14 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
for (i = 0; i < row_width; i++)
{
png_uint_16 red, green, blue, w;
png_byte hi,lo;
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
hi=*(sp)++; lo=*(sp)++;
red = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
green = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
blue = (png_uint_16)((hi << 8) | (lo));
if (red == green && red == blue)
w = red;
@@ -2505,9 +2517,15 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
for (i = 0; i < row_width; i++)
{
png_uint_16 red, green, blue, gray16;
red = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
blue = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
png_byte hi,lo;
hi=*(sp)++; lo=*(sp)++;
red = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
green = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++;
blue = (png_uint_16)((hi << 8) | (lo));
if (red != green || red != blue)
rgb_error |= 1;
gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15);

View File

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

View File

@@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.4.13 [February 6, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -150,7 +150,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
if (png_ptr == NULL || info_ptr == NULL)
return;
if (int_gamma > (png_fixed_point)PNG_UINT_31_MAX)
if (int_gamma >= (png_fixed_point)PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Limiting gamma to 21474.83");
png_gamma=PNG_UINT_31_MAX;

View File

@@ -1702,4 +1702,4 @@ main(int argc, char *argv[])
}
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_4_14 your_png_h_is_not_version_1_4_14;
typedef version_1_4_15 your_png_h_is_not_version_1_4_15;

View File

@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
* Last changed in libpng 1.4.14 [November 20, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -1063,14 +1063,13 @@ png_set_filter(png_structp png_ptr, int method, int filters)
{
switch (filters & (PNG_ALL_FILTERS | 0x07))
{
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;
#ifdef PNG_WRITE_FILTER_SUPPORTED
case 5:
case 6:
case 7: png_warning(png_ptr, "Unknown row filter for method 0");
#endif /* PNG_WRITE_FILTER_SUPPORTED */
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;
#ifdef PNG_WRITE_FILTER_SUPPORTED
break;
case PNG_FILTER_VALUE_SUB:
png_ptr->do_filter = PNG_FILTER_SUB; break;
case PNG_FILTER_VALUE_UP:
@@ -1082,6 +1081,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
default: png_ptr->do_filter = (png_byte)filters; break;
#else
default: png_warning(png_ptr, "Unknown row filter for method 0");
break;
#endif /* PNG_WRITE_FILTER_SUPPORTED */
}

View File

@@ -1,8 +1,8 @@
/* pngwutil.c - utilities to write a PNG file
*
* Last changed in libpng 1.4.8 [July 7, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.4.15 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -283,7 +283,7 @@ png_text_compress(png_structp png_ptr,
old_ptr = comp->output_ptr;
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
(png_alloc_size_t)
(comp->max_output_ptr * png_sizeof(png_charpp)));
(comp->max_output_ptr * png_sizeof(png_charp)));
png_memcpy(comp->output_ptr, old_ptr, old_max
* png_sizeof(png_charp));
png_free(png_ptr, old_ptr);

View File

@@ -1,7 +1,7 @@
VisualStudio instructions
libpng version 1.4.14 - November 20, 2014
libpng version 1.4.15 - February 12, 2015
Copyright (c) 1998-2010 Glenn Randers-Pehrson

View File

@@ -2,7 +2,7 @@
<!--
* zlib.props - location of zlib source and build
*
* libpng version 1.4.14 - November 20, 2014
* libpng version 1.4.15 - February 12, 2015
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
*

View File

@@ -1,8 +1,8 @@
Makefiles for libpng version 1.4.14 - November 20, 2014
Makefiles for libpng version 1.4.15 - February 12, 2015
makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
@@ -20,7 +20,7 @@ Makefiles for libpng version 1.4.14 - November 20, 2014
makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng14.so.14.1.4.14)
(gcc, creates libpng14.so.14.1.4.15)
makefile.freebsd => FreeBSD makefile
makefile.gcc => Generic gcc makefile
makefile.hpgcc => HPUX makefile using gcc
@@ -36,12 +36,12 @@ Makefiles for libpng version 1.4.14 - November 20, 2014
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc,
creates libpng14.so.14.1.4.14)
creates libpng14.so.14.1.4.15)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng14.so.14.1.4.14)
creates libpng14.so.14.1.4.15)
makefile.so9 => Solaris 9 makefile (gcc,
creates libpng14.so.14.1.4.14)
creates libpng14.so.14.1.4.15)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile

View File

@@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.4.14
version=1.4.15
prefix=""
libdir=""
libs=""

View File

@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
Name: libpng
Description: Loads and saves PNG files
Version: 1.4.14
Version: 1.4.15
Libs: -L${libdir} -lpng14
Cflags: -I${includedir}

View File

@@ -23,7 +23,7 @@
VERMAJ = 1
VERMIN = 4
VERMIC = 14
VERMIC = 15
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
NAME = libpng
PACKAGE = $(NAME)-$(VER)

View File

@@ -10,7 +10,7 @@
# Library name:
LIBNAME = libpng14
PNGMAJ = 14
RELEASE = 14
RELEASE = 15
# Shared library names:
LIBSO=$(LIBNAME).so

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ LIBRARY lpngce
png_get_int_32
EXPORTS
;Version 1.4.14
;Version 1.4.15
png_build_grayscale_palette @1
; png_check_sig @2
png_chunk_error @3

View File

@@ -2,7 +2,7 @@
; PNG.LIB module definition file for OS/2
;----------------------------------------
; Version 1.4.14
; Version 1.4.15
LIBRARY PNG
DESCRIPTION "PNG image compression library for OS/2"

View File

@@ -5,7 +5,7 @@
LIBRARY
EXPORTS
;Version 1.4.14
;Version 1.4.15
png_build_grayscale_palette
png_chunk_error
png_chunk_warning