2385 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
43d0aa7218 [libpng17] Removed redundant "option WRITE" from scripts/pnglibconf.dfa 2016-01-02 14:13:49 -06:00
Glenn Randers-Pehrson
89ebb4dd52 [libpng17] Happy 2016! Updated copyright year 2016-01-02 13:51:52 -06:00
Glenn Randers-Pehrson
8d18e76f2b [libpng17] Updated the manpage (libpng.3 and libpng-manual.txt) 2015-12-29 20:39:28 -06:00
Glenn Randers-Pehrson
fafbc6a458 [libpng17] Update CHANGES and ANNOUNCE, fix two trivial typos in comments 2015-12-29 19:50:41 -06:00
John Bowler
4253c4d759 tIME and text position handling
The handling of tIME and text chunks on read now records the location of the
chunks relative to PLTE and IDAT.  Behavior on write is unchanged except that if
the position was recorded on read it will be re-used.

This involves an ABI change to the png_text_struct; a one byte location field is
added (with the same meaning as the one used to record unknown chunk location.)
Because this field is only used on read there is no API change unless a png_info
from a libpng read is passed to a subsequent libpng write (this did not work
very well before 1.7; the tIME chunk could get duplicated.)

png_set_text ignores the new field, resetting it to the current position in the
read or write stream.  On write the position is set to the next location to be
written unless the write has not started (the position is before the signature)
in which case the location is set to PNG_HAVE_PLTE|PNG_AFTER_IDAT.  When the
chunk is written the position is set to the actual write location (effectively
the position is frozen.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-29 15:30:31 -08:00
Glenn Randers-Pehrson
c90572ee77 [libpng17] Updated CHANGES and ANNOUNCE 2015-12-28 19:57:26 -06:00
John Bowler
ef26a3f0fb pngcp.c: code to test zlib options
This adds code to iterate through the command line options when non-list options
have the 'all' parameter.  Used to rapidly test the effect of different zlib
options.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-28 16:17:12 -08:00
John Bowler
63ea57a796 Add NULL pz->list test to png_zlib_compress_validate
This seems safer; in fact a NULL dereference never happens because the test ends
up just doing arithmetic on NULL but it seems possible that the undefined
arithmetic can still happen if there is a bug elsewhere.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-28 16:15:36 -08:00
John Bowler
07c60a383a Correct the options handling
Setting the new, higher, option bits triggered the byte check (which is no
longer necessary).

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-28 16:14:15 -08:00
Glenn Randers-Pehrson
8d124a250a [libpng17] In projects/vstudio, merged readme.txt and WARNING into README.txt 2015-12-28 08:50:52 -06:00
Glenn Randers-Pehrson
0340dcdcbd [libpng17] Indented tables in projects/vstudio/WARNING 2015-12-27 20:50:18 -06:00
Glenn Randers-Pehrson
ff57ec2126 [libpng17] Minor update to vstudio documentation 2015-12-27 20:35:29 -06:00
Glenn Randers-Pehrson
745a926a38 [libpng17] Bump version to 1.7.0beta76 2015-12-25 08:48:02 -06:00
Glenn Randers-Pehrson
4b1d9e8c2a [libpng17] Imported from libpng-1.7.0beta75.tar v1.7.0beta75 2015-12-25 08:31:37 -06:00
Glenn Randers-Pehrson
bb4bcecaa0 [libpng17] Updated CHANGES and ANNOUNCE 2015-12-21 09:21:31 -06:00
David Drysdale
28fa0d23c1 Reverse order of tests in png_zlib_compress_validate
Undefined behaviour sanitizer currently fires for this test
with an error about member access within null pointer to
struct; put the check that relies on pz->list being non-NULL
second.
2015-12-21 11:29:34 +00:00
Glenn Randers-Pehrson
1bfeb46881 [libpng17] Update CHANGES and ANNOUNCE 2015-12-19 14:49:48 -06:00
John Bowler
ace10ed9a2 Fix release builds (incorrect debug macro)
Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-19 10:26:45 -08:00
John Bowler
156006bb1a Added an accurate 'methodical' measure
Also fix incorrect references to 'pngimage' in pngcp.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-19 09:51:41 -08:00
John Bowler
8d48a512bd Fix duplicate tIME chunk from png_write_png
Also add an example program, pngcp.c, which illustrates the problem when used to
copy pngtest.png (the result is an invalid PNG because the tIME chunk is
duplicated.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-19 09:51:07 -08:00
John Bowler
c75a0a40b4 Revert "Disable 'methodical' filter selection code"
This reverts commit 9c76207dbb86e04fd2f5eef088be72ba4a454a36.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-19 09:50:15 -08:00
Glenn Randers-Pehrson
fad9c9af47 [libpng17] Bump version to 1.7.0beta75 2015-12-19 09:25:12 -06:00
Glenn Randers-Pehrson
5695e897fd [libpng17] Imported from libpng-1.7.0beta74.tar v1.7.0beta74 2015-12-19 09:25:01 -06:00
Glenn Randers-Pehrson
0e249e9d93 [libpng17] Updated CHANGES and ANNOUNCE 2015-12-18 22:28:13 -06:00
Glenn Randers-Pehrson
a78c4e286a Merge branch 'test17' of git://github.com/daviddrysdale/libpng into libpng17 2015-12-18 18:09:31 -06:00
Glenn Randers-Pehrson
16424d20b5 [libpng17] Update CHANGES and ANNOUNCE 2015-12-18 14:41:17 -06:00
John Bowler
9c76207dbb Disable 'methodical' filter selection code
It is incomplete; it works but does not do anything useful except, maybe, on
really enormous images.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-18 09:17:41 -08:00
David Drysdale
2023c4a0a5 Add Travis build configuration
Include sanitizers and coverage (via https://coveralls.io)
2015-12-18 07:23:56 +00:00
John Bowler
69ff249bc4 Merge branch 'libpng17' into libpng17-filter-selection 2015-12-17 20:06:48 -08:00
Glenn Randers-Pehrson
844e264234 [libpng17] Updated CHANGES and ANNOUNCE 2015-12-17 20:53:54 -06:00
John Bowler
61acc4c9ed Prototype implementation of filter selection
This rewrites the code used previously in the heuristics to make it easier to
debug and introduces the 'methodical' method, which is intended to be an
expensive but reliable way of reducing image size.

The code in this commit does not work; the 'methodical' test for success does
not take account of data buffered inside zlib and, anyway, it changes the
results of pngtest so that the test fails.  This commit is just a checkpoint of
the current state; another commit will temporarily disable the 'methodical'
code.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-17 17:47:29 -08:00
John Bowler
bd0bb3ca7f Fix undefined behavior in pngvalid.c
Undefined because (png_byte) << shift is undefined if it changes the signed bit
(because png_byte is promoted to int).  The libpng exported functions
png_get_uint_32 and png_get_uint_16 handle this.

Bug reported by David Drysdale as a result of reports from UBSAN in clang 3.8.

This changes pngvalid to use BE random numbers; this used to produce errors but
these should not be fixed as a result of the previous changes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-17 12:58:36 -08:00
Glenn Randers-Pehrson
386b2b0a7b [libng17] Update CHANGES and ANNOUNCE 2015-12-15 12:26:54 -06:00
John Bowler
d103609ac5 pngvalid with 'limit' checks disabled in RC+
This widens the 'limit' check on the internally calculated error limits in the
'DIGITIZE' case (the code used prior to 1.7 for rgb_to_gray error checks) and it
changes the check to only operate in non-release builds (base build type not RC
or RELEASE.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-15 08:33:18 -08:00
Glenn Randers-Pehrson
639f8a4668 [libpng17] Update CHANGES and ANNOUNCE, fix date in pngvalid.c 2015-12-14 06:56:49 -06:00
John Bowler
aed7f7aaf9 Merge branch 'libpng17' of ../../libpng into libpng17 2015-12-13 22:28:27 -08:00
Glenn Randers-Pehrson
15b6717221 [libpng17] Update copyright years in source files. 2015-12-13 22:37:27 -06:00
Glenn Randers-Pehrson
c9fda22f76 [libpng16] Fix typo in "last-changed" date. 2015-12-13 18:25:36 -08:00
John Bowler
4891f1a5a8 Fix rgb_to_gray graylo==0 errors, build issues
Fixes to pngvalid for various reduced build configurations (eliminate unused
statics) and a fix for the case in rgb_to_gray when the digitize option reduces
graylo to 0, producing a large error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 18:02:31 -08:00
John Bowler
abe4a4f049 Remove LE/BE dependencies in pngvalid
This 'fixes' the current problem in the BE tests by not testing it, making the
BE code the same as the LE version.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 18:00:21 -08:00
Glenn Randers-Pehrson
f3fa5dce47 [libpng17] Bump version to 1.7.0beta74 2015-12-11 16:13:00 -06:00
Glenn Randers-Pehrson
17bfbce61c [libpng17] Imported from libpng-1.7.0beta73.tar v1.7.0beta73 2015-12-11 16:07:31 -06:00
Glenn Randers-Pehrson
2933c2e361 [libpng17] Changed png_struct->options from png_byte to png_uint_32, to hold
up to 16 2-bit options.
2015-12-11 14:53:54 -06:00
Glenn Randers-Pehrson
69f21bc6eb [libpng17] Combine tests for info_ptr==NULL in png_handle_PLTE(). 2015-12-11 14:28:54 -06:00
Glenn Randers-Pehrson
454408799b [libpng17] Updated ANNOUNCE and CHANGES to describe recent fix more accurately. 2015-12-09 15:55:11 -06:00
Glenn Randers-Pehrson
4c1ee27962 [libpng17] Fixed a syntax error in tests/pngstest that some shells other than
bash could not parse (Bug report by Nelson Beebe).
2015-12-09 13:29:02 -06:00
Glenn Randers-Pehrson
26090a5f43 [libpng17] Bump version to 1.7.0beta73 2015-12-08 13:03:30 -06:00
Glenn Randers-Pehrson
bfd8446816 [libpng17] Imported from libpng-1.7.0beta72.tar v1.7.0beta72 2015-12-08 12:56:55 -06:00
Glenn Randers-Pehrson
605f8d046f [libpng17] Update CHANGES and ANNOUNCE 2015-12-06 20:12:23 -06:00
John Bowler
b8ab93dc6f Fix stack smaller in write png_copy_row
This also resulted in PNG data with random row bytes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-06 11:12:17 -08:00