Commit Graph

481 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
61a9a054fd [libpng16] Imported from libpng-1.6.27rc01.tar 2016-12-27 08:24:22 -06:00
John Bowler
13a354f81e Remove 'defined' within macro
This removes the use of a macro containing the pre-processor 'defined'
operator.  It is unclear whether this is valid; a macro which
"generates" 'defined' is not permitted, but the use of the work
"generates" within the C90 standard seems to imply more than simple
substitution of an expression itself containing a well-formed defined
operation.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:43:15 -08:00
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
436ce2c6e9 [libpng16] Bump version to 1.6.26rc02 2016-10-17 12:46:41 -05:00
Glenn Randers-Pehrson
f6497e03d1 i[lbpng16] Quieted (bogus?) clang warnings about "absolute value has no effect".
Fixed offsets in contrib/intel/intel_sse.patch
2016-10-02 20:07:22 -05:00
Glenn Randers-Pehrson
ad3318ddc8 [libpng16] Bump version to 1.6.26beta03 2016-10-01 19:44:42 -05:00
John Bowler
319c9852bf Unsigned overflow
Remove all currently detected cases of unsigned overflow.  Detection is
runtime, so test case dependent.  The changes to pngvalid.c eliminate
spurious and probably invalid tests with one while loop exception.

Apart from that and the change to the dependence on the intended
unsigned overflow in pngtrans.c the changes are limited to altering the
meme for an unsigned 'x' from:

   while (x-- > 0)

to

   for (; x > 0; --x)

This works because, in all cases, the control variable is not used in
the loop.  The 'while' meme was, at one time, warn'ed by GCC so it is
probably a good change, for some weird religious value of good.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-30 18:37:22 -07:00
Glenn Randers-Pehrson
90ea4af4a1 [libpng16] Update CHANGES and ANNOUNCE 2016-09-01 17:28:08 -05:00
John Bowler
597b1a1b5e Merge branch 'libpng16' of ../../libpng into libpng16 2016-09-01 13:27:58 -07:00
John Bowler
f0b453bc3e [libpng16] pngfix zero-length IDAT fix
When an input file contains a zero length IDAT and pngfix is not applying the
IDAT rechunking (--max) option pngfix will go into a loop writing the zero
length IDAT for ever.

This is a fairly minor issue for interactive use; zero length IDAT is very rare,
the problem is obvious (pngfix hangs) and the fix (use --max, or --max=4096
etc), while not obvious, is easy.

For non-interactive use, e.g. trying to automatically repair a PNG that cannot
be read by libpng, there are security consequences:

1) pngfix hangs.  This may permit a DoS attack.
2) When the --out option is used pngfix will just keep writing.  This is a very
likely DoS scenario.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-01 07:22:40 -07:00
Glenn Randers-Pehrson
abd88841ef [libpng16] Imported from libpng-1.6.25rc05.tar 2016-08-30 11:15:49 -05:00
Glenn Randers-Pehrson
0a2d496d58 [libpng16] Imported from libpng-1.6.25rc03.tar 2016-08-29 16:10:33 -05:00
Mandar Sahastrabuddhe
ee5e39835c Added build support for MIPS MSA
Also added one msa optimized function: png_read_filter_row_up_msa

Signed-off-by: Mandar Sahastrabuddhe <Mandar.Sahastrabuddhe@imgtec.com>
2016-08-29 19:07:25 +05:30
Glenn Randers-Pehrson
4be85e1b37 [libpng16] Rebased contrib/intel/intel_sse.patch 2016-08-17 06:52:07 -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
96db0fff50 [libpng16] Conditionally compile ARM_NEON headers in pngpriv.h
Updated contrib/intel/intel_sse.patch
2016-08-02 09:31:05 -05:00
Glenn Randers-Pehrson
2c0b7a8ff6 [libpng16] Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch 2016-07-31 21:22:06 -05:00
Glenn Randers-Pehrson
0a5e99d7ee [libpng16] Rebased contrib/intel/intel_sse.patch 2016-07-24 19:39:43 -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
34c783e2fe [libpng16] Fix permission on reindent; add license info to contrib/tools/chkfmt 2016-07-14 18:53:30 -05:00
Glenn Randers-Pehrson
82d0009885 [libpng16] Add PD license to new "reindent" tool; remove unused environment var
I didn't intend to distribute this but it leaked into the libpng16 source,
so here it is.
2016-07-14 17:40:37 -05:00
Glenn Randers-Pehrson
3c7c436303 [libpng16] Imported from libpng-1.6.24beta05.tar 2016-07-14 09:55:35 -05:00
Glenn Randers-Pehrson
9b14f5f85a [libpng16] Fix a bad indent in pngvalid.c 2016-07-13 17:21:31 -05:00
Glenn Randers-Pehrson
66f796e74c [libpng16] Imported from libpng-1.6.24beta03.tar 2016-07-04 09:55:12 -05:00
John Bowler
cfc19ff1b6 pngcp bug fixes
The fixed size buffer for the file name being processed could have a byte
written beyond the end; a bug where the test was updated without changing the
size of the buffer.  This commit reduces the buffer to the system maximum.

png_getrowbytes could, in theory, return 0; probably only if there is a bug in
libpng but the code now checks.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-03 13:49:36 -07:00
Glenn Randers-Pehrson
11c88033d4 [libpng16] Added "Common linking failures" section to INSTALL 2016-07-02 14:29:29 -05:00
John Bowler
54feb0ad2a pngimage: correct #define checking
In libpng 1.7 pngimage needs to check PNG_WRITE_PNG_SUPPORTED (new in 1.7), not
PNG_WRITE_SUPPORTED because png_write_png can be disabled without disabling
PNG_WRITE_SUPPORTED.  Copied the approach from 1.6 pngcp.c (so this still works
in 1.6 as well.)
2016-07-02 08:03:09 -07:00
Glenn Randers-Pehrson
b733c50bc0 [libpng16] Updated CHANGES and ANNOUNCE 2016-07-01 18:42:07 -05:00
John Bowler
a93744423d pngcp.c: correct total time output
Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:29:58 -07:00
John Bowler
9957c45073 pngcp: add high resolution timing
If PNG_PNGCP_TIMING_SUPPORTED is defined maximal resolution CPU time logging of
png_read_png and png_write_png is enabled via the --time command line option.
This is not on by default but is enabled by contrib/conftests/pngcp.dfa

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:29:45 -07:00
John Bowler
0ac91cc657 pngcp: tool to copy PNG files
This adds pngcp to the build together with a pngcp.dfa configuration test; the
test revealed some configuration bugs which are fixed by corrections to the
_SUPPORTED macros.

pngcp builds on all tested configurations and a number of bugs have been fixed
to make this happen relative to the version in libpng 1.7 contrib/examples.
pngcp.dfa will have to be different for 1.7 but pngcp.c should work fine (not
yet tested).  pngcp itself is still missing a usage message; this is a
preliminary version, although since it behaves the same way as 'cp' most unoids
shouldn't have a problem using it correctly.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:27:43 -07:00
Glenn Randers-Pehrson
3f2879bf60 [libpng16] Imported from libpng-1.6.24beta02.tar 2016-06-23 11:26:59 -05:00
Glenn Randers-Pehrson
4b4a9583b4 [libpng16] Imported from libpng-1.6.24beta02.tar 2016-06-23 11:08:06 -05:00
John Bowler
21d9e6e0fb SKIP definition in pngstest.c misplaced
The SKIP definition needs to come after the png.h include (see all the other .c
files in contrib/libtests) because it depends on PNG_LIBPNG_VER.  This commit
puts it in the correct place.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:38:56 -07:00
John Bowler
98af505439 Fix MSVC Level 4 warning
MSVC does not like (uInt) = -(unsigned) (i.e. as an initializer), but it is fine
with it if the conversion is explicitly invoked by a cast.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:37:20 -07:00
Glenn Randers-Pehrson
6c7c5a04b8 [libpng16] More efficient absolute value calculation on SSE2 (Matthieu Darbois). 2016-06-20 08:28:34 -05:00
Matt Sarett
36762ac4b4 More efficient absolute value on SSE2 2016-06-20 09:06:25 -04:00
Glenn Randers-Pehrson
ed6db9d86b [libpng16] Imported from libpng-1.6.23.tar 2016-06-09 06:49:42 -05:00
Glenn Randers-Pehrson
f757d74898 [libpng16] Moved sse2 prototype from pngpriv.h to contrib/intel/intel_sse.patch. 2016-05-31 09:45:17 -05:00
John Bowler
bd2370c054 pngvalid.c: don't use size_t count arguments
Coverity rejects code where an array element count has type size_t, this
elminates the code in question from contrib/libtests/pngvalid.c

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-30 08:12:51 -07:00
Glenn Randers-Pehrson
dbfd68ae3a [libpng16] Update CHANGES, ANNOUNCE, and change date in pngvalid.c 2016-05-29 15:47:57 -05:00
John Bowler
801b925edf pngvalid.c: correct progressive read input buffer
The previous version of the code invariably passed just one byte at a time to
libpng.  The intention was to pass a random number of bytes in the range 0..511
(and this is what happens now).

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-29 09:30:00 -07:00
Glenn Randers-Pehrson
84cc738166 [libpng16] Imported from libpng-1.6.23beta01.tar 2016-05-29 09:47:30 -05:00
Glenn Randers-Pehrson
ac43a87820 [libpng16] Imported from libpng-1.6.22.tar 2016-05-26 07:25:14 -05:00
Glenn Randers-Pehrson
37ab4d946c [libpng16] Imported from libpng-1.6.22rc03.tar 2016-05-18 07:26:06 -05:00
Glenn Randers-Pehrson
0794fee913 [libpng16] Imported from libpng-1.6.22beta06.tar 2016-05-05 19:37:54 -05:00
Glenn Randers-Pehrson
21939d36ec [libpng16] Use PNG_UINT_31_MAX instead of constant 0x7fffffff in timepng.c 2016-04-29 21:48:52 -05:00
Glenn Randers-Pehrson
8c754b1834 [libpng16] Quieted two Coverity issues in contrib/libtests/timepng.c. 2016-04-28 21:23:37 -05:00
Glenn Randers-Pehrson
2b9f68631c [libpng16] Rebased contrib/intel_sse.patch. 2016-04-27 22:40:39 -05:00
Glenn Randers-Pehrson
eefd9127ca [libpng16] Imported from libpng-1.6.22beta05.tar 2016-04-27 13:01:14 -05:00