Commit Graph

707 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
a1fe2c9848 [libpng16] Check length of IDAT against maximum possible IDAT size, accounting
for height, rowbytes, interlacing and zlib/deflate overhead.
2017-08-03 10:01:35 -05:00
Glenn Randers-Pehrson
347538efbd [libng16] Check length of all chunks except IDAT against user limit. 2017-08-02 19:21:19 -05:00
Glenn Randers-Pehrson
3fa1df48a1 [libpng16] Removed png_get_eXIf_1() and png_set_eXIf_1(). 2017-08-02 17:27:41 -05:00
Glenn Randers-Pehrson
fd6b87253c [libpng16] Eliminate local eXIf_buf from png_handle_eXIf() 2017-08-02 06:35:15 -05:00
Glenn Randers-Pehrson
71a56180e5 [libpng16] Stop memory leak when returning from png_handle_eXIf() with an error
(Bug report from the OSS-fuzz project).
2017-08-01 21:42:16 -05:00
Glenn Randers-Pehrson
bc68c41d5f [libpng16] Initialized btoa[] in pngstest.c; stop memory leak in png_handle_eXIf()
when returning with an error.
2017-08-01 15:24:21 -05:00
Glenn Randers-Pehrson
3524b0d201 [libpng16] Update "Last changed" dates and some copyright years 2017-07-31 17:03:17 -05:00
Glenn Randers-Pehrson
3e753f5cbe [libpng16] Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1()
and png_set_eXIf_1(), respectively, to avoid breaking API compatibility
with libpng-1.6.31.
2017-07-31 16:56:30 -05:00
Glenn Randers-Pehrson
40afb68570 [libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf()
in pngwrite.c, and made various other fixes to png_write_eXIf().
Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
  to arguments for png_get_eXIf() and png_set_eXIf().
2017-07-31 14:21:46 -05:00
Glenn Randers-Pehrson
4ab78af90a [libpng16] Avoid possible NULL dereference in png_handle_eXIf when benign_errors
are allowed. Avoid leaking the input buffer "eXIf_buf".
2017-07-30 19:36:25 -05:00
Glenn Randers-Pehrson
9fcb846402 [libpng16] Imported from libpng-1.6.31.tar 2017-07-27 05:27:17 -05:00
Glenn Randers-Pehrson
68cb0aaee3 [libpng16] Implement eXIf chunk support 2017-07-13 11:22:48 -05:00
John Bowler
72d07d3202 [libpng16] Removed one of the GCC-7.1.0 'strict-overflow' warnings that
result when integers appear on both sides of a compare.  Worked around the
  others by forcing the strict-overflow setting in the relevant functions to
  a level where they are not reported.
Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
  the space.
Worked around some C-style casts from (void*) because g++ 5.4.0 objects
  to them.
Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
  overflow' check that is on by default with -Wall -Wextra.
2017-07-11 08:47:05 -05:00
Glenn Randers-Pehrson
9f7134c3fc [libpng16] Update some "last changed" dates 2017-06-29 17:52:18 -05:00
Glenn Randers-Pehrson
2eff8ef504 [libpng16] Imported from libpng-1.6.30beta02.tar 2017-04-22 15:46:59 -05:00
Glenn Randers-Pehrson
e744ee1338 [libpng16] Update CHANGES, ANNOUNCE, and "last changed" dates. 2017-03-30 12:24:55 -05:00
Viktor Szakats
8c50acb9d2 silence clang -Wcomma warnings 2017-03-29 23:54:40 +00:00
Glenn Randers-Pehrson
d42e88d5b3 [libpng16] Imported from libpng-1.6.29.tar 2017-03-16 07:26:33 -05:00
Glenn Randers-Pehrson
a7029a5b4c [libpng16] Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in
pngrutil.c because Solaris 11 distributes zlib-1.2.8.f that is older
than 1.2.8.1.
2017-03-01 06:52:16 -06:00
Glenn Randers-Pehrson
8c6c9e6d56 [libpng16] Update credits to include Google Inc, for the Intel/SSE patch. 2017-01-12 09:45:02 -06:00
Glenn Randers-Pehrson
4ddac468c4 [libpng16] Bump version to 1.6.29beta01 2017-01-05 11:37:54 -06:00
Glenn Randers-Pehrson
17ad597dba [libpng16] Imported from libpng-1.6.28.tar 2017-01-05 07:59:36 -06:00
Glenn Randers-Pehrson
b9b490c7f5 [libpng16] Bump version to 1.6.28beta01 2016-12-30 08:29:24 -06:00
Glenn Randers-Pehrson
a3b5edc934 [libpng16] Bump version to 1.6.27 2016-12-29 07:50:33 -06:00
Glenn Randers-Pehrson
8187ba1518 [libpng16] PNG_IGNORE_ALDLER32_SUPPORTED -> PNG_IGNORE_ADLER32 in pngtest.c 2016-12-26 18:15:02 -06:00
Glenn Randers-Pehrson
dbb5fce3d8 [libpng16] Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. 2016-12-26 18:00:46 -06:00
Glenn Randers-Pehrson
d65a92b951 [libpng16] Revert ADLER32 error handling in pngrutil.c and pngpread.c. 2016-11-08 16:04:08 -06:00
Glenn Randers-Pehrson
2accfbd6f3 [libpng16] Restrict the new ADLER32-skipping to IDAT chunks. It broke iCCP
chunk handling.
2016-10-28 15:50:46 -05:00
Glenn Randers-Pehrson
858cb585d7 [libpng16] Bump version to 1.6.27beta01 2016-10-28 15:25:26 -05:00
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
a1312f7b19 [libpng16] Cosmetic change "ptr != 0" to "ptr != NULL" in png.c and pngrutil.c 2016-10-16 14:34:40 -05:00
Glenn Randers-Pehrson
a106899acd [libpng16] Use zlib-1.2.8.1 inflateValidate() instead of inflateReset2() to
avoid ADLER32 evaluation.
2016-10-07 13:33:50 -05:00
Glenn Randers-Pehrson
3875d9af4c [libpng16] Quieted 45 (out of 86 remaining) -Wconversion compiler warnings 2016-10-02 17:08:46 -05:00
Glenn Randers-Pehrson
89ea081433 [libpng16] If CRC handling of critical chunks has been set to PNG_CRC_QUIET_USE,
ignore the ADLER32 checksum in the IDAT chunk as well as the chunk CRCs.
2016-09-25 17:42:15 -05:00
Glenn Randers-Pehrson
7835716cef [libpng16] Changed PNG_ZLIB_VERNUM to ZLIB_VERNUM in pngpriv.h, pngstruct.h,
and pngrutil.c.
2016-09-19 16:46:54 -05:00
Glenn Randers-Pehrson
1842d7c865 [libpng16] Issue a png_benign_error instead of a png_error on ADLER32 mismatch
while decoding compressed data chunks.
2016-09-11 22:02:05 -05:00
Glenn Randers-Pehrson
e3a6631123 [libpng16] Imported from libpng-1.6.25.tar 2016-08-31 22:30:47 -05:00
Glenn Randers-Pehrson
935676cdad [libpng16] Revert use of png_malloc_array in iCCP chunk reader 2016-08-12 06:58:15 -05:00
Glenn Randers-Pehrson
8ff2ed2fe1 [libng16] Conditionally compile png_inflate(). It's not needed for iCCP
chunk reading.
2016-08-11 20:13:33 -05:00
Glenn Randers-Pehrson
19fefd3a4b [libpng16] Return NULL from png_malloc_array() with a warning instead of calling
png_error() on failure.  Reject oversized iCCP profile immediately.
2016-08-10 12:09:22 -05:00
Glenn Randers-Pehrson
b50d5cea2b [libpng16] Imported from libpng-1.6.24.tar 2016-08-03 21:32:26 -05:00
Glenn Randers-Pehrson
8d091a640b [libpng16] Conditionally compile png_decompress_chunk(). 2016-08-01 17:50:42 -05:00
Glenn Randers-Pehrson
ee079481c9 [libpng16] Imported from libpng-1.6.24beta06.tar 2016-07-19 17:00:00 -05:00
Glenn Randers-Pehrson
639b48625f [libpng16] Eliminated unnecessary tests of boolean png_isaligned() vs 0. 2016-07-15 17:22:10 -05:00
Glenn Randers-Pehrson
dd70604cec [libpng16] Fixed more indentation 2016-07-15 11:20:46 -05:00
Glenn Randers-Pehrson
0fd9a249de [libpng16] Update "last changed" dates 2016-07-13 16:29:22 -05:00
Glenn Randers-Pehrson
192e92d681 [libpng16] Fixed some indentation to comply with our coding style. 2016-07-13 14:43:42 -05:00
Glenn Randers-Pehrson
80495124b2 [libpng16] Don't call png_icc_set_sRGB() when it's not compiled. 2016-07-03 10:28:54 -05:00
Glenn Randers-Pehrson
66db757dd4 [libpng16] Happy 2016! Updated copyright year 2016-01-02 13:40:27 -06:00
Glenn Randers-Pehrson
4d8de33979 [libpng16] Update copyright uears in source files. 2015-12-13 22:41:17 -06:00
Glenn Randers-Pehrson
0de0101fdd [libpng16] Bump version to 1.6.21beta01 2015-12-08 22:19:15 -06:00
Glenn Randers-Pehrson
5b6a6f914b [libpng16] Imported from libpng-1.6.20.tar 2015-12-02 22:30:37 -06:00
John Bowler
28a1cdfc2e Fix inconsistent handling of invalid zlib data
In libpng 1.6 zlib initialization was changed to use the window size in the zlib
stream, not a fixed value.  This causes some invalid images, ones where CINFO is
too large, to display 'correctly' if the rest of the data is valid.  This
provides a work-round for zlib versions where the error arises (ones that
support the API change to use the window size in the stream).

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-27 23:57:39 -08:00
Glenn Randers-Pehrson
27f08ac11d [lbpng16] Revert 12 -> 12U change in pngrutil.c 2015-11-22 22:59:47 -06:00
Glenn Randers-Pehrson
8ba160ba94 [libpng16] Use unsigned constants in buffer length comparisons 2015-11-21 14:31:59 -06:00
John Bowler
1ceedd0bf6 [libpng16] Another whack at png_handle_sPLT() pointer calculation. 2015-11-19 20:45:08 -06:00
Glenn Randers-Pehrson
001513c9ca [libpng16] Removed new redundant check for libpng < 12 in pngrutil.c 2015-11-17 16:23:51 -06:00
Glenn Randers-Pehrson
162f9f87f9 [libpng16] Remove newly-added useless typecasts. 2015-11-16 09:23:25 -06:00
Glenn Randers-Pehrson
9965f63a44 [libpng16] Changed size_t to png_uint_32 in new buffer checks (John Bowler) 2015-11-15 15:27:22 -06:00
Glenn Randers-Pehrson
070a0eb58f [libpng16] Revised recent pngrutil.c patch as suggested by pascal 2015-11-14 16:45:26 -06:00
Glenn Randers-Pehrson
0b4e7deab1 [libpng16] Avoid potential pointer overflow in png_handle_sPLT() and
png_handle_pCAL() (Bug report by John Regehr).
2015-11-13 11:05:27 -06:00
Glenn Randers-Pehrson
415d26805a [libpng16] Imported from libpng-1.6.19.tar 2015-11-12 07:13:31 -06:00
Glenn Randers-Pehrson
83f4c735c8 [libpng16] Clean up coding style in png_handle_PLTE() 2015-11-05 11:18:44 -06:00
Glenn Randers-Pehrson
9f2ad4928e [libpng16] Fixed new bug with CRC error after reading an over-length palette. 2015-11-04 23:47:42 -06:00
Glenn Randers-Pehrson
1bef8e9799 [libpng16] Silently truncate over-length PLTE chunk while reading. 2015-10-30 11:34:37 -05:00
Glenn Randers-Pehrson
a901eb3ce6 [libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta). 2015-10-30 07:57:49 -05:00
John Bowler
2d62f7406f [libpng16] Fixed the recently reported 1's complement security issue by
replacing the value that is illegal in the PNG spec, in both signed and
unsigned values, with 0. Illegal unsigned values (anything greater than or equal
to  0x80000000) can still pass through, but since these are not illegal
in ANSI-C (unlike 0x80000000 in the signed case) the checking that
occurs later can catch them (John Bowler).
2015-08-19 12:56:48 -05:00
Glenn Randers-Pehrson
a8242fe6fb [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL 2015-08-17 20:46:27 -05:00
Glenn Randers-Pehrson
15e69748f1 [libpng16] Removed new unnecessary typecast in pngrutil.c 2015-08-17 12:52:56 -05:00
Glenn Randers-Pehrson
268c7bf68b [libpng16] Use unsigned hex constants in "reciprocal" computations 2015-08-17 12:40:19 -05:00
Glenn Randers-Pehrson
d8b93c29a7 [libpng16] Appended more "UL" to hex constants. 2015-08-17 10:56:17 -05:00
Glenn Randers-Pehrson
b9ba8d6a57 [libpng16] Mention in manual that 16-bit platform support has been dropped. 2015-08-16 23:32:04 -05:00
Glenn Randers-Pehrson
8b83ff3704 [libpng16] Change "n bit" to "n-bit" in comments. 2015-08-13 20:57:18 -05:00
Glenn Randers-Pehrson
e485a09e0e [libpng16] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).  Several warnings remain and are
unavoidable, where we test for overflow.
2015-07-29 07:29:17 -05:00
Glenn Randers-Pehrson
e6172809bd [libpng16] Imported from libpng-1.6.18.tar 2015-07-22 22:40:52 -05:00
Glenn Randers-Pehrson
f86720c6c0 [libpng16] Fix some indentation. 2015-06-11 22:00:14 -05:00
John Bowler
8ee821e69a [libpng16] PNG_RELEASE_BUILD replaces tests where the code depended on the build base
type and can be defined on the command line, allowing testing in beta builds. Back
ported from libpng17.
2015-05-06 20:03:14 -05:00
Glenn Randers-Pehrson
c861dc8923 [libpng16] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).
2015-04-01 12:06:01 -05:00
Glenn Randers-Pehrson
bd85b5713c [libpng16] Imported from libpng-1.6.18beta01.tar 2015-04-01 08:24:14 -05:00
Glenn Randers-Pehrson
d344589703 [libpng16] Removed PNG_SET_CHUNK_[CACHE|MALLOC]_LIMIT_SUPPORTED macros. They
have been combined with PNG_SET_USER_LIMITS_SUPPORTED (resolves
bug report by Andrew Church).
2015-03-27 08:58:32 -05:00
Glenn Randers-Pehrson
c98f7fb4e3 [libpng16] Imported from libpng-1.6.17.tar 2015-03-26 08:11:12 -05:00
Glenn Randers-Pehrson
c5370ede95 [libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
2015-03-21 11:54:32 -05:00
Glenn Randers-Pehrson
bb098218ca [libpng16] Fixed some spelling (occur* -> occurr*), Bug report by Lauri Nurmi 2015-03-07 12:59:48 -06:00
Glenn Randers-Pehrson
7011a8cec3 [libpng16] Added "& 0xff" to things being typecast to "png_byte". 2015-02-27 18:53:44 -06:00
Sergey Kosarevsky
9a3de48b48 [libpng16] Avoid runtime checks when converting integer to png_byte with
Visual Studio (Sergey Kosarevsky)
2015-02-27 18:47:43 -06:00
Glenn Randers-Pehrson
6ef579df50 [libpng16] Imported from libpng-1.6.17beta01.tar 2015-01-28 19:15:16 -06:00
Glenn Randers-Pehrson
bd76965879 [libpng16] Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
2015-01-27 06:53:56 -06:00
Glenn Randers-Pehrson
018b4fccb9 [libpng16] Happy New Year! Update copyright year. 2014-12-31 18:45:23 -06:00
John Bowler
dc294204b6 [libpng16] Fixed an overflow in png_combine_row with very wide interlaced
images.
2014-12-21 17:11:33 -06:00
Glenn Randers-Pehrson
06ee38423b [libpng16] Imported from libpng-1.6.16rc02.tar 2014-12-21 13:54:45 -06:00
Glenn Randers-Pehrson
6d8c88177a [libpng16] Imported from libpng-1.6.16rc01.tar 2014-12-21 09:18:15 -06:00
Glenn Randers-Pehrson
f43b5e3709 [libpng16] Imported from libpng-1.6.16beta03.tar 2014-12-20 19:21:32 -06:00
Glenn Randers-Pehrson
e8ef689cb9 [libpng16] Imported from libpng-1.6.15.tar 2014-11-20 10:22:57 -06:00
Glenn Randers-Pehrson
cda68df8c1 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */" 2014-11-06 22:11:39 -06:00
Glenn Randers-Pehrson
b963feeec6 [libpng16] More cosmetic changes 2014-11-01 13:18:36 -05:00
Glenn Randers-Pehrson
5d713fe123 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to
"if (x !== 0)"
2014-10-31 20:58:40 -05:00
Glenn Randers-Pehrson
c6a8cb7d10 [libpng16] Added missing "ptr = NULL" after some instances of png_free(). 2014-10-29 08:27:34 -05:00
Glenn Randers-Pehrson
ebba0746bc [libpng16] Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)" 2014-10-25 12:22:39 -05:00
Glenn Randers-Pehrson
edb772fd6d [libpng16] Imported from libpng-1.6.14.tar 2014-10-22 19:32:52 -05:00
Glenn Randers-Pehrson
48e6fad71c [libpng16] Fixed incorrect handling of the iTXt compression flag
in pngrutil.c (bug report by Shunsaku Hirata).  Bug was introduced
in libpng-1.6.0.
2014-09-27 09:37:50 -05:00