940 Commits

Author SHA1 Message Date
John Bowler
3184947a25 chunk handling and transform rewrite
This implements a new chunk parse implementation that can be shared, it
is currently shared by the progressive reader and the sequential one
(not, yet, the writer).

The patch also implements shared transform handling that is used
throughout.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 20:42:40 -07:00
Glenn Randers-Pehrson
064ededa0f [libpng17] Bump version to 1.7.0beta65 2015-07-25 21:24:46 -05:00
Glenn Randers-Pehrson
92d7dd1ede [libpng17] Imported from libpng-1.7.0beta64.tar 2015-07-25 21:17:14 -05:00
Glenn Randers-Pehrson
3d1fec50e8 [libpng17] Bump version to 1.7.0beta64 2015-06-06 17:02:10 -05:00
Glenn Randers-Pehrson
0781bc4905 [libpng17] Imported from libpng-1.7.0beta63.tar 2015-06-06 16:30:46 -05:00
John Bowler
1a9eb510eb [libpng17] Moved READ_GAMMA to pngrtran.c. This makes everything in pngrtrans.c
depend on READ_TRANSFORMS and moves all the transform gamma (READ_GAMMA)
code from elsewhere to png_tran.c.  There are no code changes.
There is one remaining use of the gamma (16-bit) code in the simplified
API in pngread.c but that is because of a long-standing libpng bug,
namely that the gamma corrected palette is no produced by
png_read_update_info (John Bowler).
2015-06-04 21:49:54 -05:00
Glenn Randers-Pehrson
77476d3c37 [libpng16] Quieted Coverity issues in pngfix.c, png-fix-itxt.c, pngvalid.c,
pngstest.c, and pngimage.c. Most seem harmless, but png-fix-itxt
would only work with iTXt chunks with length 255 or less.

Fixed cexcept.h in which GCC 5 reported that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp, and fixed g++ build breaks (John Bowler).
2015-06-03 22:52:33 -05:00
Glenn Randers-Pehrson
f32c657fc7 [libpng17] Bump version to 1.7.0beta63 2015-06-01 09:32:03 -05:00
Glenn Randers-Pehrson
f19f7a6c95 [libpng17] Bump version to 1.7.0beta62 2015-05-30 23:08:34 -05:00
Glenn Randers-Pehrson
e0fea61cd8 [libpng17] Imported from libpng-1.7.0beta61.tar 2015-05-30 23:03:01 -05:00
Glenn Randers-Pehrson
689b9c58fe [libpng17] Avoid a harmless potential integer overflow in png_XYZ_from_xy(). 2015-05-20 13:18:54 -05:00
Glenn Randers-Pehrson
9012e3d108 [libpng17] Bump version to 1.7.0beta61 2015-05-06 16:17:19 -05:00
Glenn Randers-Pehrson
81d58f913e [libpng17] Imported from libpng-1.7.0beta60.tar 2015-05-06 15:59:29 -05:00
Glenn Randers-Pehrson
6acc280403 [libpng17] Bump version to 1.7.0beta60 2015-04-19 06:32:37 -05:00
Glenn Randers-Pehrson
01358ecec2 [libpng17] Imported from libpng-1.7.0beta59.tar 2015-04-19 06:32:30 -05:00
Glenn Randers-Pehrson
7a35bcac1a [libpng17] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).
2015-04-04 08:45:34 -05:00
John Bowler
673ae608ab [libpng17] Transformed rewrite: changed row_info, added checks. This introduces an
internal struct (png_transform_control) to replace row_info and uses
    that to implement affirms correctly.  The change also adds checks on
    the rowbytes calculation and additional checks on most transform
    implementations.
Added png_uint_16 range checking, pngvalid tRNS, fixed png_uint_16:
    review of previous checks, removal of some where SAFE. pngvalid: add
    testing of tRNS for better code coverage pngvalid: correct rgb-to-gray
    error calculations. Code coverage is still incomplete: see /*UNTESTED*/
    in pngrtran.c
2015-03-30 21:32:41 -05:00
Glenn Randers-Pehrson
73ea393ab2 [libpng17] Bump version to 1.7.0beta59 2015-03-25 08:26:11 -05:00
John Bowler
53097f5bbb [libpng17] Check (png_uint_16) casts for overflow. Also removed png_muldiv_warn,
added RELEASE/!RELEASE convenience macros. png_muldiv_warn was used in
only one place, and the overflow condition is a genuine warning not
an internal error.  Four macros allow code or function parameters to be
condition on RELEASE (or not) builds and tidy up the #ifdef handling of
functions.
2015-03-22 20:26:13 -05:00
John Bowler
36562c1032 [libpng17] Improved some overflow handling. 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.  Overflows previously
handled by png_warning in png.c have been changed to use new
macros/affirm functions so that beta builds will abort on overflow and
release builds will quietly ignore it.  This avoids release builds
producing warnings that are of no use to end users.
2015-03-22 16:05:56 -05:00
John Bowler
82fa6aed0e [libpng17] Added byte, short and other overflow checking
Added 'assert' based overflow checking for debug builds for char
and short assignments. Simply ignore the error in release builds
(a truncated value will be used without warning). Controlled by
PNG_RANGE_CHECK_SUPPORTED.
2015-03-22 15:57:53 -05:00
Glenn Randers-Pehrson
06963c7841 [libpng16] Renamed "assert" to "affirm", not affected by NDEBUG. 2015-03-21 21:33:42 -05:00
John Bowler
2460d9494d [libpng17] Implemented assert support and usage. 2015-03-20 16:39:56 -05:00
Glenn Randers-Pehrson
033dd3f20a [libpng17] Bump version to 1.7.0beta58 2015-03-17 08:13:42 -05:00
Glenn Randers-Pehrson
341e23c009 [libpng17] Imported from libpng-1.7.0beta57.tar 2015-03-17 08:00:27 -05:00
Glenn Randers-Pehrson
e57ab4311b [libpng17] Bump version to 1.7.0beta57 2015-03-11 18:14:01 -05:00
Glenn Randers-Pehrson
9015c44736 [libpng17] Imported from libpng-1.7.0beta56.tar 2015-03-11 17:50:01 -05:00
Glenn Randers-Pehrson
c4c28d7251 [libpng17] Bump version to 1.7.0beta56 2015-03-09 09:28:06 -05:00
Glenn Randers-Pehrson
0fba15c567 [libpng17] Imported from libpng-1.7.0beta55.tar 2015-03-09 09:16:18 -05:00
Glenn Randers-Pehrson
c062330846 [libpng16] Free the unknown_chunks structure even when it contains no data. 2015-03-09 09:05:39 -05:00
Glenn Randers-Pehrson
0448d90f01 [libpng17] Merged png_free_data() with libpng-1.6.17rc02. 2015-03-09 09:04:02 -05:00
Glenn Randers-Pehrson
3e4bd8c261 [libpng17] Spelling fixes ("then", "occured") reported by Lauri Nurmi. 2015-03-07 14:00:13 -06:00
Glenn Randers-Pehrson
79a332afd0 [libpng17] Bump version to 1.7.0beta55 2015-03-04 11:25:05 -06:00
Glenn Randers-Pehrson
352e2fe4c7 [libpng17] Imported from libpng-1.7.0beta54.tar 2015-03-04 11:19:43 -06:00
Glenn Randers-Pehrson
678020ae18 [libpng17] Bump version to 1.7.0beta54 2015-02-25 15:42:29 -06:00
Glenn Randers-Pehrson
58e69e45ff [libpng17] Imported from libpng-1.7.0beta53.tar 2015-02-25 15:17:50 -06:00
Glenn Randers-Pehrson
5f7e71fa78 [libpng17] Restored compiling of png_reciprocal2 with PNG_NO_16BIT. 2015-02-22 16:42:54 -06:00
Glenn Randers-Pehrson
0cd3d25ae8 [libpng17] Bump version to 1.7.0beta53 2015-02-21 12:50:08 -06:00
Glenn Randers-Pehrson
83a2959908 [libpng17] Imported from libpng-1.7.0beta52.tar 2015-02-21 12:49:54 -06:00
Glenn Randers-Pehrson
9c7aee825c [libpng17] Bump version to 1.7.0beta52 2015-02-17 10:52:59 -06:00
Glenn Randers-Pehrson
d8055d7123 [libpng17] Imported from libpng-1.7.0beta51.tar 2015-02-17 10:52:45 -06:00
Glenn Randers-Pehrson
d368235da4 [libpng17] Bump version to 1.7.0beta51 2015-02-15 14:27:48 -06:00
Glenn Randers-Pehrson
06b0c83920 [libpng17] Imported from libpng-1.7.0beta50.tar 2015-02-15 13:20:53 -06:00
Glenn Randers-Pehrson
7e56f5858d [libpng17] Bump version to 1.7.0beta50 2015-02-11 07:25:31 -06:00
Glenn Randers-Pehrson
82fca45d27 [libpng17] Imported from libpng-1.7.0beta49.tar 2015-02-11 07:25:24 -06:00
Glenn Randers-Pehrson
ba22b208ed [libpng17] Bump version to 1.7.0beta49 2015-02-07 09:16:28 -06:00
Glenn Randers-Pehrson
6ce2d220b4 [lipng17] Do not build png_product2() when it is unused and work around
one more Coverity-scan dead-code warning.
2015-02-07 08:54:07 -06:00
Glenn Randers-Pehrson
d7312be749 [libpng17] Improved the comments on some #ifdef lines. 2015-02-03 19:11:50 -06:00
Glenn Randers-Pehrson
125eac0ee4 [libpng17] Bump version to 1.7.0beta48 2015-01-28 19:30:45 -06:00
Glenn Randers-Pehrson
3043819fb2 [libpng17] Quieted some Coverity warnings 2015-01-27 15:54:37 -06:00