Commit Graph

520 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
8d16725373 [libpng16] Stop a potential memleak in png_set_tRNS() (Bug report by Ted Ying). 2016-05-27 19:55:44 -05:00
Glenn Randers-Pehrson
1a3fa1e091 [libpng16] Imported from libpng-1.6.22beta03.tar 2016-03-09 12:04:40 -06:00
Glenn Randers-Pehrson
5031c77d85 [libpng16] Bump version to 1.6.22beta01 2016-01-16 08:00:09 -06:00
Glenn Randers-Pehrson
fc0786a442 [libpng16] Imported from libpng-1.6.21.tar 2016-01-15 13:51:06 -06:00
Glenn Randers-Pehrson
66db757dd4 [libpng16] Happy 2016! Updated copyright year 2016-01-02 13:40:27 -06:00
Glenn Randers-Pehrson
975cbbb029 [libpng16] Moved png_check_keyword() from pngwutil.c to pngset.c 2015-12-13 15:04:18 -06:00
Glenn Randers-Pehrson
0a9afc12de [libpng16] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr
not info_ptr.
2015-11-22 20:53:02 -06:00
Glenn Randers-Pehrson
f1cdf4e1ca [libpng16] Bump version to 1.6.20beta01 2015-11-13 10:18:18 -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
408dbac801 [libpng16] Fixed some inconsequential cut-and-paste typos
in png_set_cHRM_XYZ_fixed().
2015-11-01 12:38:33 -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
Glenn Randers-Pehrson
a8242fe6fb [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL 2015-08-17 20:46:27 -05:00
Glenn Randers-Pehrson
d8b93c29a7 [libpng16] Appended more "UL" to hex constants. 2015-08-17 10:56: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
e0f0d05938 [libpng16] Replaced "unexpected" with an integer (0xabadca11) in pngset.c 2015-04-29 11:29:31 -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
c98f7fb4e3 [libpng16] Imported from libpng-1.6.17.tar 2015-03-26 08:11:12 -05:00
Glenn Randers-Pehrson
06ee532286 [libpng16] Reverted new test on unknown chunk location; it was bogus. 2015-03-08 08:00:45 -05:00
Glenn Randers-Pehrson
217d38cdea [libpng16] Stopped a potential memory leak in png_set_unknown_chunks(). Breaks
tests/pngunknown-sAPI so it's temporarily marked SKIP.
2015-03-07 10:35:03 -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
7a015b92b2 [libpng16] Update "last changed" comment in pngset.c 2015-01-13 09:41:25 -06:00
Glenn Randers-Pehrson
2f56fe4071 [libpng16] Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
2015-01-13 09:25:48 -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
John Bowler
03df189954 [libpng16] Fixed array size calculations to avoid warnings. At various points
in the code the number of elements in an array is calculated using
sizeof.  This generates a compile time constant of type (size_t) which
is then typically assigned to an (unsigned int) or (int). Some versions
of GCC on 64-bit systems warn about the apparent narrowing, even though
the same compiler does apparently generate the correct, in-range,
numeric constant.  This adds appropriate, safe, casts to make the
warnings go away.
2014-11-05 17:19:36 -06: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
11d4a2a451 [libpng16] Imported from libpng-1.6.15beta01.tar 2014-10-29 09:08:46 -05:00
Glenn Randers-Pehrson
6cae24c265 [libpng16] Fixed some typos in comments. 2014-10-13 11:11:21 -05:00
Glenn Randers-Pehrson
9127138a30 [libpng16] Fix typos in comments in pngset.c and pngtrans.c 2014-10-03 20:23:31 -05:00
Glenn Randers-Pehrson
212fd5745d [libpng16] Bump version to 1.6.13beta01 2014-06-11 21:13:33 -05:00
Glenn Randers-Pehrson
e429c66cea [libpng16] Imported from libpng-1.6.12.tar 2014-06-11 20:41:51 -05:00
Glenn Randers-Pehrson
da7b692ce0 [libpng16] Bump version to 1.6.12beta01 2014-06-06 11:57:30 -05:00
Glenn Randers-Pehrson
c4e0f3de64 [libpng16] Imported from libpng-1.6.11.tar 2014-06-05 10:00:45 -05:00
Glenn Randers-Pehrson
05670156f3 [libpng16] Use "if (value != 0)" instead of "if (value)" consistently. 2014-03-08 12:39:52 -06:00
Glenn Randers-Pehrson
be3977de2c [libpng16] Imported from libpng-1.6.8.tar 2013-12-19 09:11:01 -06:00
Glenn Randers-Pehrson
67f101e6c9 [libpng16] Imported from libpng-1.6.8rc02.tar 2013-12-14 12:42:36 -06:00
Glenn Randers-Pehrson
b6f0a641cb [libpng16] Imported from libpng-1.6.8rc01.tar 2013-12-11 23:28:18 -06:00
Glenn Randers-Pehrson
847e9efb66 [libpng16] Imported from libpng-1.6.3.tar 2013-07-17 19:13:23 -05:00
Glenn Randers-Pehrson
746bc7d883 [libpng16] Imported from libpng-1.6.3beta07.tar 2013-06-08 17:03:26 -05:00
Glenn Randers-Pehrson
421f95deb5 [libpng16] Removed a redundant test in png_set_IHDR(). 2013-06-04 15:05:12 -05:00
Glenn Randers-Pehrson
399430dac2 [libpng16] Update "last changed" comments. 2013-04-25 09:52:00 -05:00
Glenn Randers-Pehrson
3f677d1c65 [libpng16] Bump version to 1.6.3beta01 2013-04-25 09:19:04 -05:00
Glenn Randers-Pehrson
809355b4aa [libpng16] Imported from libpng-1.6.2.tar 2013-04-25 07:29:41 -05:00
Glenn Randers-Pehrson
7ef0c46488 [libpng16] Updated "last changed" comments. 2013-04-18 07:25:45 -05:00
Glenn Randers-Pehrson
5087805e7c [libpng16] Imported from libpng-1.6.1.tar 2013-03-27 20:36:57 -05:00
Glenn Randers-Pehrson
871b1d0fab [libpng16] Bump version to 1.6.1beta05 2013-03-02 15:03:15 -06:00
Glenn Randers-Pehrson
f3af706c2a [libpng16] Imported from libpng-1.6.0beta05.tar 2013-03-01 21:38:03 -06:00
John Bowler
c0a0d4a6d2 [libpng16] Reenabled code to allow zero length PLTE chunks for MNG. 2013-02-18 21:23:17 -06:00
Glenn Randers-Pehrson
b4ef7c4af2 [libpng16] Use parentheses consistently in "#if defined()" tests.
Folded some long lines.
2013-02-17 15:41:36 -06:00
Glenn Randers-Pehrson
c53778ff53 [libpng16] Imported from libpng-1.6.0.tar 2013-02-13 22:53:57 -06:00
John Bowler
2414bd99d8 [libpng16] Use consistent handling of overflows in text, sPLT and unknown
png_set_* APIs
2013-01-19 23:18:59 -06:00
Glenn Randers-Pehrson
590c8b0987 [libpng16] Added overflow detection in png_set_sPLT() and png_set_text_2(). 2013-01-19 08:49:12 -06:00
John Bowler
9dd2bfafe5 [libpng16] Corrected previous attempt at overflow detection in
png_set_unknown_chunks().
2013-01-17 13:24:05 -06:00
John Bowler
1c6e22a360 [libpng16] Fixed conceivable but difficult to repro overflow. Also added
two test programs to generate and test a PNG which should have the problem.
2013-01-10 10:55:34 -06:00
Glenn Randers-Pehrson
9477ecdfa6 [libpng16] Updated copyright year to 2013 in newly-changed files 2013-01-01 07:45:42 -06:00
Glenn Randers-Pehrson
6dae6d8f3b [libpng16] Imported from libpng-1.6.0beta32.tar 2012-11-25 12:47:44 -06:00
John Bowler
520803d57e [libpng16] Removed non-working ICC profile support code. There was too much
code for too little gain; implementing full ICC color correction is maybe
desireable but is left up to applications.
2012-11-01 08:12:47 -05:00
John Bowler
f8dfd123e2 [libpng16] Changed ICC profile support to allow use of an external color
management system (CMS). In practice it is not possible to obtain cHRM
information reliably using just the end-point tags because they do not exist
in the vast majority of profiles.  Instead it is necessary to run the endpoints
through the ICC colorimetric intent transform (as described in the v4
spec).  Since this is likely to be too much code inside libpng for too
little gain (it implies a fairly complete CMS implementation) the code
has been changed to allow an external CMS to be used.  This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
2012-10-25 19:30:02 -05:00
John Bowler
b98681b49a [libpng16] Improved ICC profile handling including cHRM chunk generation and
fixed Cygwin+MSVC build errors. The ICC profile handling now includes more
checking.  Several errors that caused rejection of the profile are now
handled with a warning in such a way that the invalid profiles will be
read by default in release (but not pre-RC) builds but will not be
written by default.  The easy part of handling a cHRM chunk is written,
where the ICC profile contains the required data.  The more difficult
part plus guessing a gAMA value requires code to pass selected RGB values
through the profile.
2012-09-04 16:35:20 -05:00
John Bowler
14d0ca620e [libpng16] Cleaned up and corrected ICC profile handling.
contrib/libtests/makepng: corrected 'rgb' and 'gray' cases.  profile_error
    messages could be truncated; made a correct buffer size calculation and
    adjusted pngerror.c appropriately. png_icc_check_* checking improved;
    changed the functions to receive the correct color type of the PNG on read
    or write and check that it matches the color space of the profile (despite
    what the comments said before, there is danger in assuming the app will
    cope correctly with an RGB profile on a grayscale image and, since it
    violates the PNG spec, allowing it is certain to produce inconsistent
    app behavior and might even cause app crashes.) Check that profiles
    contain the tags needed to process the PNG (tags all required by the ICC
    spec). Removed unused PNG_STATIC from pngpriv.h.
2012-08-25 16:21:46 -05:00
Glenn Randers-Pehrson
702053d110 [libpng16] Bump version to 1.6.0beta28 2012-08-17 21:54:45 -05:00
John Bowler
4a6c6df6c7 [libpng16] Allow fine grain control of unknown chunk APIs. This change allows
png_set_keep_unknown_chunks() to be turned off if not required and causes
both read and write to behave appropriately (on read this is only possible
if the user callback is used to handle unknown chunks).  The change
also removes the support for storing unknown chunks in the info_struct
if the only unknown handling enabled is via the callback, allowing libpng
to be configured with callback reading and none of the unnecessary code.
2012-08-16 16:12:13 -05:00
John Bowler
e9567514dd [libpng16] Unknown handling fixes and clean up. This adds more correct option
control of the unknown handling, corrects the pre-existing bug where
the per-chunk 'keep' setting is ignored and makes it possible to skip
IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
There is a new test program, test-unknown.c, which is a work in progress
(not currently part of the test suite).  Comments in the header files now
explain how the unknown handling works.
2012-08-15 22:53:00 -05:00
John Bowler
aa9dea57d7 [libpng16] Work around gcc 3.x and Microsoft Visual Studio 2010 complaints.
Both object to the split initialization of num_chunks.
2012-08-10 19:04:08 -05:00
Glenn Randers-Pehrson
ece07cfe9c [libpng16] Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(),
and png_memcmp() macros.
2012-08-10 18:19:41 -05:00
Glenn Randers-Pehrson
dbb7e19fda [libpng16] Consistently use memset(), memcpy(), and memcmp() instead of the
png_memset(), png_memcpy(), and png_memcmp() macros.
2012-08-10 17:27:42 -05:00
John Bowler
134c5761fa [libpng16] Fix new leak when text compression is disabled. 2012-08-10 10:49:21 -05:00
Glenn Randers-Pehrson
4430b91363 [libpng16] Restore info_ptr members that were deleted by the previous
patch; they are needed by png_set_IHDR() for both read and write.  Fix
some ifdefs that caused the contrib/pngminim/ applications to not compile.
2012-08-09 22:24:04 -05:00
Glenn Randers-Pehrson
432c174b64 [libpng16] Eliminated use of png_sizeof(); use sizeof() instead, and use.
a consistent style for (sizeof type) and (sizeof (array))
2012-08-09 20:14:48 -05:00
Glenn Randers-Pehrson
96b917056d [libpng16] Revised png_set_keep_unknown_chunks() so num_chunks < 0 means
ignore all unknown chunks and all known chunks except for IHDR, PLTE, tRNS,
IDAT, and IEND.  Previously it only meant ignore all unknown chunks, the
same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
provide a list of chunks to be processed instead of a list of chunks to
ignore.  Revised contrib/gregbook/readpng2.c accordingly.
2012-06-16 13:26:28 -05:00
Glenn Randers-Pehrson
8f4d67218e [libpng16] Imported from libpng-1.6.0beta22.tar 2012-05-23 13:19:30 -05:00
Glenn Randers-Pehrson
e243a1fbd8 [libpng16] Enable png_set_check_for_invalid_index() for both read and write. 2012-04-13 12:35:21 -05:00
Glenn Randers-Pehrson
96027d919f [libpng16] Imported from libpng-1.6.0beta20.tar 2012-03-29 06:38:51 -05:00
John Bowler
b11b31aea2 [libpng16] Changed chunk handler warnings into benign errors, incrementally
load iCCP
2012-03-21 07:55:46 -05:00
Glenn Randers-Pehrson
ce9d8a3f48 [libpng16] Imported from libpng-1.6.0beta19.tar 2012-03-19 10:54:55 -05:00
Glenn Randers-Pehrson
f5dcba6b9b [libpng16] Never mind, undid previous change. 2012-03-17 00:21:45 -05:00
Glenn Randers-Pehrson
c26d6e9aac [libpng16] Revised png_set_text_2() to avoid possible memory corruption
when writing.
2012-03-16 23:19:02 -05:00
Glenn Randers-Pehrson
dd6ecbe688 [libpng16] Imported from libpng-1.6.0beta18.tar 2012-03-16 08:34:31 -05:00
Glenn Randers-Pehrson
945cb1f9be [libpng16] Issue a png_benign_error() instead of png_warning() about bad
palette index.
2012-03-10 08:48:04 -06:00
John Bowler
b5d0051dcb [libpng16] Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c.  A new shared keyword check routine was also added
and the 'zbuf' is no longer allocated on progressive read.  It is now
possible to call png_inflate() incrementally.
2012-03-09 09:15:18 -06:00
Glenn Randers-Pehrson
0c98cc7023 [libpng16] Imported from libpng-1.6.0beta16.tar 2012-03-05 21:28:03 -06:00
Glenn Randers-Pehrson
eeb1bb678d [libng16] Added palette-index checking while writing.
Relocated palette-index checking function from pngrutil.c to pngtrans.c
2012-03-02 22:10:15 -06:00
Glenn Randers-Pehrson
1531bd61a0 [libpng16] Updated copyright year to 2012 2012-01-01 14:45:04 -06:00
John Bowler
fcd301daed [libpng16] Changed png_memcpy to C assignment where appropriate. Changed all
those uses of png_memcpy that were doing a simple assignment to assignments
(all those cases where the thing being copied is a non-array C L-value.)
Added some error checking to png_set_*() routines and removed the
reference to the non-exported function png_memcpy() from example.c. Fixed
the Visual C 64-bit build - it requires jmp_buf to be aligned, but it had
become misaligned.
2011-12-28 21:34:27 -06:00
John Bowler
4f67e40898 [libpng16] Add 'const' to png_structrp arguments of png_set_*() APIs.
Because these APIs store to the png_info they can take a
 png_const_structrp now that the error routines also accept
 one of these.
2011-12-28 08:43:37 -06:00
John Bowler
5d56786eff [libpng16] Implemented 'restrict' for png_info and png_struct.
Added new "png_structrp" typedef. Because of the
way libpng works both png_info and png_struct are always accessed via a
single pointer.  This means adding C99 'restrict' to the pointer gives
the compiler some opportunity to optimize the code.  This change allows that.
2011-12-24 09:12:00 -06:00
Glenn Randers-Pehrson
67ee8cee39 [libpng16] bump version to 1.6.0beta04 2011-12-22 08:34:26 -06:00
John Bowler
40b2603687 [libpng16] Start-up code size improvements, error handler flexibility. These
changes alter how the tricky allocation of the initial png_struct and png_info
structures are handled. png_info is now handled in pretty much the same
way as everything else, except that the allocations handle NULL return
silently.  png_struct is changed in a similar way on allocation and on
deallocation a 'safety' error handler is put in place (which should never
be required).  The error handler itself is changed to permit mismatches
in the application and libpng error buffer size; however, this means a
silent change to the API to return the jmp_buf if the size doesn't match
the size from the libpng compilation; libpng now allocates the memory and
this may fail.  Overall these changes result in slight code size
reductions; however, this is a reduction in code that is always executed
so is particularly valuable.  Overall on a 64-bit system the libpng DLL
decreases in code size by 1733 bytes.  pngerror.o increases in size by
about 465 bytes because of the new functionality.
2011-12-22 08:09:15 -06:00
Glenn Randers-Pehrson
29fca795b9 [libpng15] Validate time settings passed to pngset()
and png_convert_to_rfc1123(). (Frank Busse).
2011-11-19 15:08:04 -06:00
Glenn Randers-Pehrson
55e85c24b4 [libpng15] Imported from libpng-1.5.7beta01.tar 2011-11-04 13:47:49 -05:00
Glenn Randers-Pehrson
2b7d730e27 [libpng15] Bump version to libpng-1.5.7beta01 2011-11-02 23:14:13 -05:00
Glenn Randers-Pehrson
bc6726bc04 [libpng15] Imported from libpng-1.5.6.tar 2011-11-02 22:48:36 -05:00
Glenn Randers-Pehrson
bb5cb1476b [libpng15] Bump version to libpng-1.5.6beta02 2011-09-22 12:48:19 -05:00
Glenn Randers-Pehrson
115020d985 [libpng15] Imported from libpng-1.5.6beta01.tar 2011-09-22 09:51:23 -05:00
Glenn Randers-Pehrson
3e2263abf2 [libpng15] Imported from libpng-1.5.5.tar 2011-09-22 08:45:04 -05:00
John Bowler
751561218f [libpng15] Constant changes for 64-bit compatibility (removal of L suffixes).
The 16-bit cases still use "L" as we don't have a 16-bit test system.
2011-09-09 17:21:44 -05:00
John Bowler
f3f7e14727 [libpng15] Fixed 64-bit compilation errors (gcc). The errors fixed relate
to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world.  This produces potential truncation errors which the
compiler correctly flags.
2011-09-09 07:32:37 -05:00
Glenn Randers-Pehrson
4ae297867d [devel] Bump version to libpng-1.5.5beta07 2011-08-26 06:07:33 -05:00
John Bowler
736f40f459 [devel] Fixes to rgb_to_gray and cHRM XYZ APIs 2011-08-25 16:19:44 -05:00