2440 Commits

Author SHA1 Message Date
John Bowler
52c9e4fdd6 signed/unsigned warning fix (GCC 4.8.5)
Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-09 16:36:15 -07:00
John Bowler
4905ed4aae Reenable filter selection (dummy)
This implements the code for row-by-row filter selection but does not provide an
actual implementation; the selection function just chooses the lowest set filter
bit.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-09 13:08:50 -07:00
Glenn Randers-Pehrson
ba356b4e4d [libpng17] Bump version to 1.7.0beta81 2016-05-07 15:45:03 -05:00
Glenn Randers-Pehrson
d23207b866 [libpng17] Imported from libpng-1.7.0beta80.tar v1.7.0beta80 2016-05-07 15:44:55 -05:00
John Bowler
a70f5053de [libpng17] Update CHANGES and ANNOUNCE about pngcp; sync timepng.c with libpng16 2016-05-06 19:09:58 -05:00
John Bowler
4cc89fb733 Minor write bug-fixes, remove unimplemented code
A debug() assert fired if windowBits was set to 8 for the Huffman only and
no-compression cases.  This commit changes it to do some extra checking.  Remove
unreachable code in pz_default_settings, eliminate a spurious warning in pngcp
for small files.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-06 14:35:35 -07:00
Glenn Randers-Pehrson
e966fac5ac [libpng17] Update CHANGES and ANNOUNCE for Write code update (John Bowler) 2016-05-04 22:02:52 -05:00
John Bowler
cde9b583a8 Write code update
Implemented better defaulting of zlib settings based on image properties.
Implemented pass-through of png_write_rows when the rows can be used directly (a
common case) optimizing the handling of previous-row buffering.

Removed the METHODICAL filter selection method and disabled the HEURISTIC one;
the first was ridiculously slow (though useful for experiments) the second
doesn't work.  Filter selection is temporarily disabled (it defaults to the
lowest numbered filter in the list; typically 'none').

New handling of compression settings (incomplete), new PNG compression level
(not yet visible in an API).

Back ported 'PNG_FAST_FILTERS' from 1.6 (in png.h).

There are minimal API changes beyond removal of the selection options.  Work is
still to be done to investigate a filter selection mechanism that is at least as
good as the previous one.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-04 17:02:20 -07:00
Glenn Randers-Pehrson
1fd42d849d [libpng17] Bump version to 1.7.0beta80 2016-03-09 12:05:09 -06:00
Glenn Randers-Pehrson
b6a1f48ab2 [libpng17] Imported from libpng-1.7.0beta79.tar v1.7.0beta79 2016-03-09 12:05:00 -06:00
Glenn Randers-Pehrson
bbe8ea6eb0 [libpng17] Fixed some misleading indentation (Krishnaraj Bhat). 2016-03-07 07:49:09 -06:00
Glenn Randers-Pehrson
6d2e06f25f [libpng17] Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in
png.h (Robert C. Seacord). Various other flags in png.h made unsigned as well.
2016-02-14 13:13:20 -06:00
Glenn Randers-Pehrson
3fb14ea53b [libpng17] Make cmake install pnglibconf.h; rename some tests to be
similar to the names generated by "configure"
2016-02-09 08:54:17 -06:00
John Bowler
af9ad9545d Write compression options
More sophisticated defaulting which helps significantly for some files along
with code to make it easier to control the compression defaults and to make the
settings honor the API calls the application makes (previously low windowBits
settings would get reset to higher values.)

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-02 05:58:38 -08:00
Glenn Randers-Pehrson
5e88e9c396 [libpng17] Update CHANGES and ANNOUNCE 2016-02-02 07:46:12 -06:00
John Bowler
8498aa1c97 Expand search logging
Output results during the search; not a perfect implementation but sufficient
for basic tests on zlib parameters.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-01 18:04:31 -08:00
Roger Leigh
8fb81acd98 [libpng17] Deleted pngstest-pngsuite from CMakeLists.txt 2016-01-30 21:20:55 -06:00
Glenn Randers-Pehrson
1a087bf921 [libpng17] Update copyright info in CMakeLists.txt 2016-01-30 17:19:49 -06:00
Roger Leigh
5a857b7d83 [libpng17] Remove extra pngvalid test from CMakeLists.txt 2016-01-30 17:04:51 -06:00
John Bowler
e2414effed pngcp: 1.6 support and better --search output
Some refinements for the search option and better (more consistent) reporting of
the results plus changes so that when compiled against libpng 1.6 the program
correctly copies text chunks; previously when a search option caused multiple
copies of the same file the copies after the first would not have the text
chunks.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-30 14:09:39 -08:00
Glenn Randers-Pehrson
023b399e40 [libpng17] Mention pngchunk.h in documentation 2016-01-30 09:47:13 -06:00
Glenn Randers-Pehrson
0b073f4a4d [libpng17] Add pngchunk.h dependency and remove some redundant
dependencies from CMakeLists.txt
2016-01-30 09:44:44 -06:00
Glenn Randers-Pehrson
a8b45d9f7e [libpng17] Removed pngstest-pngsuite test from CMakeLists.txt 2016-01-30 09:31:33 -06:00
Roger Leigh
c39c5640b4 [libpng17] Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
and test.cmake.in (Roger Leigh).
2016-01-29 17:27:39 -06:00
Glenn Randers-Pehrson
eb5e71cc8c [libpng17] Update CHANGES, ANNOUNCE, and some "last changed" dates 2016-01-29 16:20:34 -06:00
John Bowler
85cb69aa82 Forward port libpng16 fixes
Batched fixes from libpng16: PNG_IMAGE_PNG_SIZE_MAX macro fix, contrib/libtests
exit(77) change to just do that for configure and changes to pngstest to
(by default) make random backgrounds on a per-file, not per-session, basis.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-28 23:11:33 -08:00
Glenn Randers-Pehrson
dcb3f792d9 [libpng17] Bump version to 1.7.0beta79 2016-01-23 14:57:49 -06:00
Glenn Randers-Pehrson
9a6922896d [libpng17] Imported from libpng-1.7.0beta78.tar v1.7.0beta78 2016-01-23 14:06:48 -06:00
Glenn Randers-Pehrson
55d3b3226e [libpng17] Document new png_image_write_to_memory() API 2016-01-23 13:59:24 -06:00
Glenn Randers-Pehrson
443694d7ac [libpng17] Revised workaround for Coverity issue in pngvalid.c 2016-01-23 10:10:52 -06:00
Glenn Randers-Pehrson
f26fa77ef8 [libpng17] Updated CHANGES and ANNOUNCE, fixed typo in pngunknown.c comment. 2016-01-19 08:32:18 -06:00
John Bowler
e46cd2e6bc Simplified API: use system appropriate types
This is an API change for 1.7, albeit a quiet one; it may produce compiler
warnings but should not result in errors, unless warnings are treated as errors.

On 64-bit systems it widens the results of the various PNG_IMAGE_ macros that
return size values (component counts, byte sizes) to 64 bits.  It also changes
the row_stride parameter, which is the pointer difference between adjacent rows
of the image buffer, to ptrdiff_t which is the ANSI-C90 defined type of the
difference of two pointers.  The existing (1.6.22) checks for overflow are
preserved but now accomdate images that require more than 32 bits of address
space when size_t/ptrdiff_t are 64 bit types.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 20:44:26 -08:00
John Bowler
f2a160299e pngunknown: update date 2016-01-18 12:02:40 -08:00
John Bowler
4697cbded6 Simplified API: write-to-memory, overflow handling
This implements an API and provides a number of assist macros to allow an
application which uses the simplified API write to bypass stdio and write
directly to memory.

It also includes some warnings (png.h) and some check code to detect *possible*
overflow in the ROW_STRIDE and simplified image SIZE macros.  This disallows
image width/height/format that *might* overflow.  A quiet API change that limits
in-memory image size (uncompressed) to less that 4GByte and image row size
(stride) to less than 2GByte.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 11:50:30 -08:00
John Bowler
033a0d7b49 pngunknown: fix NO_STDIO build
pngunknown.c calls png_init_io (always), skip the test if there is no stdio.h
support.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 11:34:13 -08:00
Glenn Randers-Pehrson
eacf6f9637 [libpng17] Changed PNG_USE_MKSTEMP to __COVERITY__ to select alternate
"tmpfile()" implementation in contrib/libtests/pngstest.c
2016-01-17 16:03:10 -06:00
Glenn Randers-Pehrson
7912bf3037 [libpng17] Bump version to 1.7.0beta78 2016-01-16 08:00:36 -06:00
Glenn Randers-Pehrson
e4fad63915 [libpng17] Imported from libpng-1.7.0beta77.tar v1.7.0beta77 2016-01-16 08:00:23 -06:00
Glenn Randers-Pehrson
89287f10b8 [libpng17] Worked around a false-positive Coverity issue in pngvalid.c. 2016-01-13 09:48:41 -06:00
Glenn Randers-Pehrson
6271b4fc78 [libpng17] Updated CHANGES and ANNOUNCE 2016-01-12 14:44:47 -06:00
John Bowler
3d024874a5 Recently introduced palette sharing bug
The internal read code change to stop sharing the palette was incompletely
implemented.  The result is that unless palette index checking is turned off and
there are no read transformations the png_info palette gets deleted when the
png_struct is deleted.  This is normally harmless (png_info gets deleted first)
but in the case of pngcp it results in use-after-free of the palette and,
therefore, palette corruption and maybe on some operating systems and access
violation.

This also updated pngcp 'search' mode to check a restricted range of memLevels;
there is an unrelated bug which means that lower zlib memLevels result in memory
corruption under some circumstances, probably less often than 1:1000.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-12 09:36:10 -08:00
Glenn Randers-Pehrson
2fce16e5c4 [libpng17] Update CHANGES and ANNOUNCE, fix typo in png.h 2016-01-10 19:34:16 -06:00
John Bowler
fc322f6d48 Add pngcp IDAT size test
Also change the order of the 'level' and 'windowBits' searches to seach
windowBits first; this favours windowBits optimizations over compression level
ones on the basis that the latter should only affect the write code.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-10 13:53:47 -08:00
John Bowler
1afbb57994 IDAT read buffering correction
The sequential read code failed to read to the end of the IDAT stream in about
1/820 cases, resulting in a spurious warning.  The
png_set_compression_buffer_size API also would not work (or do bad things) if
the size of a zlib uInt was less than 32 bits.

This includes a quiet API change to alter png_set_compression_buffer_size to use
a png_alloc_size_t, not png_size_t and implement the correct checks.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-10 13:51:29 -08:00
John Bowler
e393f19527 Fix write problem with reduced size IDAT chunks
png_set_compression_buffer_size would result in a spurious debug assert if the
compression buffer size was set to something other than a multiple of
PNG_ROW_BUFFER_SIZE; the debug test failed to add the buffer 'start'

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-10 13:49:34 -08:00
John Bowler
79378d49b3 [libpng17] Changed copyright and license in pngcp.c to be nearly public domain
similar to the other files in the contrib/examples directory.
2016-01-10 12:09:38 -06:00
Glenn Randers-Pehrson
d9d6b6e361 [libpng17] Update CHANGES and ANNOUNCE 2016-01-10 08:00:00 -06:00
John Bowler
b9014ed336 contrib/examples/pngcp search mode
This is still a work-in-progress but it seems fairly stable (if not exactly 100%
optimal).  pngcp now allows 'all' for some options which iterates through all
possible settings (this reliably produces the smallest IDAT that libpng can
produce with those settings.)  It also contains a --search command line option
which attempts to optimize this by skipping pointless tests; it is close, most
of the time, but not perfect.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-09 17:40:55 -08:00
John Bowler
faf68f8d57 Fix for serious write bugs in pngwutil.c
There are two separate problems.  The first is that the CMINFO optimization code
gets run twice on any PNG IDAT stream longer than 2048 bytes and the second time
can overwrite bytes 2048,2049 destroying the output.

The second is that one of the (debug) checks was slightly wrong (< when <=
should have been used) and this causes write to abort maybe 1/2048 times.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-09 17:38:34 -08:00
Glenn Randers-Pehrson
09a1afbb3d [libpng17] Fixed another Coverity defect, NULL dereference "ps" in pngwutil.c 2016-01-08 18:59:36 -06:00