396 Commits

Author SHA1 Message Date
John Bowler
95e0094f85 Eliminate signed overlow in png_64bit_product
The previous version produced a signed overflow as a result of both the
& 0xffff on the most significant bits of a negative argument; this
converted (-1) into 65535 which resulted in a subsequent overflow.
Since signed overflow is undefined in C90 the code has been modified to
correctly calculate a signed result.  This requires changing the 'hi'
result parametr to a signed value.

This has been code reviewed solely by the author.  A further code review
is highly desireable.  Nevertheless the code compiles without warnings
from clang and without the prior detection of an overflow.  Since it no
longer truncates any of the intermediate values this should be enough to
ensure that it is correct.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:29:16 -08:00
Glenn Randers-Pehrson
6fb875a54e [libpng15] Imported from libpng-1.5.27.tar 2016-05-26 07:24:57 -05:00
Glenn Randers-Pehrson
684c68d6fb [libpng15] Bump version to 1.5.27beta01 2015-12-17 20:09:18 -06:00
Glenn Randers-Pehrson
94322f3f8f [libpng15] Imported from libpng-1.5.26.tar 2015-12-17 08:11:20 -06:00
Glenn Randers-Pehrson
fd3cd9fad2 [libpng15] Update some last-changed dates 2015-12-13 18:36:30 -06:00
John Bowler
e40ac66f81 [libpng15] Do png_check_keyword in png_set_*() 2015-12-13 18:10:53 -06:00
Glenn Randers-Pehrson
a510a813ef [libpng15] Remove new redundant prototype for png_set_keyword() 2015-12-13 17:35:11 -06:00
Glenn Randers-Pehrson
2b5be93866 [libpng15] Move png_check_keyword() from pngwutil.c to pngset.c 2015-12-13 16:18:58 -06:00
Glenn Randers-Pehrson
75318bc745 [libpng15] Imported from libpng-1.5.24beta01.tar 2015-08-19 12:54:24 -05:00
Glenn Randers-Pehrson
a058d6cee0 [libpng15] Imported from libpng-1.5.23.tar 2015-07-22 22:40:33 -05:00
Glenn Randers-Pehrson
d522ff063f [libpng15] Removed non-working progressive reader 'skip' function. 2015-06-03 17:09:47 -05:00
Glenn Randers-Pehrson
8a6253ed6f [libpng15] Merged pngtest.c with libpng-1.6.17/pngtest.c
Display user limits in the output from pngtest.
Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
  and 1-million-row default limits in pnglibconf.dfa, that can be reset
  by the user at build time or run time.  This provides a more robust
  defense against DOS and as-yet undiscovered overflows.
2015-02-16 22:56:30 -06:00
Cosmin Truta
7852e7786b [libpng15] Use memcpy instead of CopyMemory in the definition of png_memcpy.
The Borland C++ build breaks otherwise (Cosmin).
2014-11-14 09:41:41 -06:00
Glenn Randers-Pehrson
6c9ef75c6b [libpng15] Update "last changed" dates. 2014-08-21 09:50:28 -05:00
Glenn Randers-Pehrson
e99366837d [libpng15] Bump version to 1.5.20beta01 2014-08-21 09:15:51 -05:00
Glenn Randers-Pehrson
e73cc88b21 [libpng15] Imported from libpng-1.5.19.tar 2014-08-21 05:57:34 -05:00
Glenn Randers-Pehrson
1f1c0aec9b [libpng15] Moved redefinitions of png_error() and related macros from
pngpriv.h to png.h to make them visible to libpng-calling applications.
2014-02-17 07:25:48 -06:00
Glenn Randers-Pehrson
3adf7f7bc8 [libpng15] Bump version to 1.5.19beta01 2014-02-06 10:42:45 -06:00
Glenn Randers-Pehrson
4449a29e1e [libpng15] Imported from libpng-1.5.18.tar 2014-02-05 22:27:21 -06:00
Glenn Randers-Pehrson
77adefeda6 [libpng15] Updated copyright year in recently-changed files. 2013-12-31 21:06:14 -06:00
John Bowler
71fcb39efc [libpng15] Merged pngvalid and pngtest from libpng-1.5; made compressed chunks
after IDAT work with the progressive read code (this is a minor and
somewhat ugly fix-up; the proper fix is in 1.6).
2013-12-29 10:44:25 -06:00
John Bowler
bd7143e6eb [libpng15] Fixed 'unused' warnings and mergeed with libpng16 pngvalid.
Various warnings revealed by configurations added to the tested
configurations in libpng 1.6 need corresponding fixes in libpng 1.5.
This takes the libpng 1.6 pngvalid.c and adds it back to libpng 1.5,
however one write-only test is currently disabled because it does not
work; possibly because of failures to reset or initialize the deflate
stream correctly in write-only cases.
2013-12-27 07:27:17 -06:00
Glenn Randers-Pehrson
1feb6e2ef5 [libpng15] Bump version to 1.5.18beta01 2013-06-28 19:59:05 -05:00
Glenn Randers-Pehrson
25c8915f7c [libpng15] Imported from libpng-1.5.17.tar 2013-06-26 22:30:48 -05:00
Glenn Randers-Pehrson
567bdd03e3 [libpng15] Imported from libpng-1.5.17rc01.tar 2013-06-17 07:57:28 -05:00
Glenn Randers-Pehrson
a6f079d4d7 [libpng15] Imported from libpng-1.5.17beta01.tar 2013-06-08 16:50:19 -05:00
John Bowler
ffeb8f0d09 [libpng15] Port ARM support changes from libpng-1.6.3beta07. 2013-06-08 13:57:56 -05:00
Glenn Randers-Pehrson
bc92887b2d [libpng15] Imported from libpng-1.5.16beta06.tar 2013-05-12 18:34:58 -05:00
Glenn Randers-Pehrson
ae8174d9a3 [libpng15] Imported from libpng-1.5.15beta06.tar 2013-05-12 12:12:08 -05:00
Glenn Randers-Pehrson
10de36ef25 [libpng15] Imported from libpng-1.5.15.tar 2013-03-27 20:26:28 -05:00
Glenn Randers-Pehrson
e67a47a19a [libpng15] Bump version to 1.5.15beta06 2013-02-17 22:09:27 -06:00
Glenn Randers-Pehrson
fb908d6ae2 [libpng15] Redo previous checkin; fold long lines and fix #ifdefs 2013-02-17 21:41:43 -06:00
John Bowler
c9f2269857 [libpng15] Enabled renaming of the extern (but not DLL exported) ARM filter
functions.  Also enabled inclusion of pngpriv.h in non-C files by preventing
C/C++ specific definitions if PNG_VERSION_INFO_ONLY is defined.
2013-02-04 17:49:11 -06:00
John Bowler
84dc479108 [libpng15] De-configured build fixes to make a range of deconfiguration options
(such as switching off read or write support) work in more cases.  Also
upgraded pngtest and pngvalid to the libpng 1.6 versions (with some
modifications) which provide more extensive testing.  Replaced pngtest.png
because pngtest writes the ancillary chunks in a different order.
2013-01-06 12:38:39 -06:00
John Bowler
62cfc893e0 [libpng15] Rearranged building of ARM NEON optimizations. The ARM specific code
is split out entirely to the arm subdirectory and changes to configure.ac and
Makefile.am to add new stuff are reduced.  Now material code changes,
although for build test purposes, --enable-arm-neon now builds on non-ARM
systems.
Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.2.5.
2012-12-14 22:05:08 -06:00
Glenn Randers-Pehrson
33b90debc5 [libpng15] Minor edit of documentation 2012-10-10 14:58:41 -05:00
Glenn Randers-Pehrson
95ea04f925 [libpng15] Folded some long lines; updated manual about removed macros 2012-08-16 00:56:45 -05:00
Glenn Randers-Pehrson
e088ce7363 [libpng15] Imported from libpng-1.5.11.tar 2012-06-14 06:33:45 -05:00
Glenn Randers-Pehrson
8a3b400826 [libpng15] Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
declaration of png_handle_unknown().
2012-04-23 23:04:32 -05:00
Glenn Randers-Pehrson
b57e9b747f [libpng15] Bump version to 1.5.11beta01 2012-04-12 10:33:00 -05:00
Glenn Randers-Pehrson
38a706f83f [libpng15] Imported from libpng-1.5.10.tar 2012-03-29 06:33:41 -05:00
Glenn Randers-Pehrson
0ff5150f91 [libpng15] Reject all iCCP chunks after the first,
even if the first one is invalid.
2012-03-09 22:38:06 -06:00
Glenn Randers-Pehrson
454e05a63a [libpng15] Added palette-index checking. 2012-03-04 22:30:06 -06:00
Glenn Randers-Pehrson
65de519c4a [libpng15] Revised the SAFE_LIMITS feature to be the same as the feature in
libpng16.  Added information about the new limits in the manual.
2012-02-24 16:54:12 -06:00
Glenn Randers-Pehrson
cd3f5bb507 [libpng15] Imported from libpng-1.5.7.tar 2011-12-15 09:50:23 -06:00
John Bowler
4491fa237f [libpng15] Remove simplified interface 2011-11-23 15:41:29 -06:00
John Bowler
17878c6e65 [libpng15] Work around compilers that don't support declaration of const data.
Some compilers fault 'extern const' data declarations (because the data is
not initialized); this turns on const-ness only for compilers where
this is known to work.
2011-11-16 22:37:46 -06:00
John Bowler
4fa96a42f7 [libpng15] Fixes for C++ compilation using g++ When libpng source is compiled
using g++. The compiler imposes C++ rules on the C source; thus it
    is desireable to make the source work with either C or C++ rules
    without throwing away useful error information.  This change adds
    png_voidcast to allow C semantic (void*) cases or the corresponding
    C++ static_cast operation, as appropriate.
2011-11-16 16:39:16 -06:00
Glenn Randers-Pehrson
45bb9a62ba [libpng15] Changed "PNG_EXTERN" to "extern" in sRGB table declarations
in pngpriv.h
2011-11-16 12:47:33 -06:00
Glenn Randers-Pehrson
8596468e51 [libpng15] Removed PNG_CONST from the sRGB table declarations
in pngpriv.h and png.c
2011-11-16 08:52:36 -06:00