Commit Graph

481 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
a967818235 [libpng16] Moved INTEL-SSE code from pngpriv.h to contrib/intel/intel_sse.patch. 2016-04-19 08:23:10 -05:00
John Bowler
af9d06e06a timepng: better errors, fix signed overflow
Too many input files would overflow nfiles

Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-13 10:04:08 -07:00
John Bowler
703944c39d timepng: C++ fixes, correct add_one_file
timepng would could a file as added even if it failed and the assembly file got
rewound.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-13 09:37:25 -07:00
John Bowler
e81f16bf5d timepng: more support requirements
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:17:22 -07:00
John Bowler
7572840cd0 timepng requires STDIO
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:10:04 -07:00
John Bowler
569a1d27b4 Fix timepng 'skip' return code.
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:04:27 -07:00
John Bowler
d642eede9a timepng: fix builds when there is no read support
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:01:50 -07:00
John Bowler
5b0a0ded05 ANSI C overlength string fix
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 20:43:29 -07:00
Glenn Randers-Pehrson
5765a22249 [libpng16] Eliminate PNG_NO_INTEL_SSE_3BPP from intel INSTALL 2016-04-05 12:33:17 -05:00
Glenn Randers-Pehrson
f47e1d4995 [libpng16] Eliminated PNG_NO_INTEL_SSE_3BPP which was just for testing. 2016-04-05 12:16:27 -05:00
Mike Klein
8f506d3257 SSE filter speed improvements for bpp=3.
- memcpy-free implementations of load3() / store3().
    These should have less variance compiler to compiler.

    - call load3() only when needed at the end of a scanline.
    In the middle, we can use the faster load4(), ignoring that byte.
2016-04-04 16:10:09 -04:00
Glenn Randers-Pehrson
1a3fa1e091 [libpng16] Imported from libpng-1.6.22beta03.tar 2016-03-09 12:04:40 -06:00
Krishnaraj Bhat
46c47291e8 gcc6: fix misleading indentation warning
Although not a bug in this case, but shows up when -Wall is used
2016-03-07 13:56:15 +05:30
John Bowler
2a25fc41f6 [libpng16] timepng usage message, ability to cache the test set
This makes tests slightly quicker by allowing the temporary file to be created
beforehand.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-28 12:24:52 -06:00
Glenn Randers-Pehrson
0df91242a2 [libpng16] Update CHANGES and ANNOUNCE, about timepng.c 2016-02-26 19:35:59 -06:00
John Bowler
9821954ecc contrib/libtests/timepng: make robust, improve
The code no longer gives up/fails on invalid PNG data, it just skips it (with
error messages).  The code no longer fails on PNG files with data beyond IEND.
Options exist to use png_read_png (reading the whole image, not by row) and, in
that case, to apply any of the supported transforms.  This makes for more
realistic testing; the decoded data actually gets used in a meaningful fashion.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-26 16:33:38 -08:00
Glenn Randers-Pehrson
e2d113cadf [libpng16] Updated INSTALL instructions for intel SSE code 2016-02-23 09:29:08 -06:00
Glenn Randers-Pehrson
b4f9f5d041 [libpng16] Fixed cut-and-paste errors in the new intel_sse.patch
and added PNG_NO_INTEL_SSE_3BPP macro.
2016-02-22 18:50:59 -06:00
Glenn Randers-Pehrson
6c3d5bd2a0 [libpng16] Moved contrib/intel/*.patch into INSTALL and added intel_sse.patch 2016-02-22 16:38:10 -06:00
Glenn Randers-Pehrson
da9d1d7aa6 [libpng16] Added pngdebug() statements to the new intel code and the arm code. 2016-02-19 14:58:59 -06:00
Glenn Randers-Pehrson
52846504da [libpng16] Fix copyright in sse code, use C-style comments 2016-02-19 09:46:51 -06:00
Glenn Randers-Pehrson
d06d66e899 [libpng16] Added contrib/intel/INSTALL 2016-02-18 22:17:46 -06:00
Glenn Randers-Pehrson
cdd9a23fd4 [libpng16] Fixed include directives in two new intel files to reflect
their new location in contrib/intel/* (was intel/*)
2016-02-18 21:23:24 -06:00
Matt Sarett
c3a45944e2 Fix paths in Makefile.am.patch 2016-02-18 12:45:13 -05:00
Matt Sarett
342c4eab2a Move sse opts into contrib/intel 2016-02-18 12:43:50 -05:00
Glenn Randers-Pehrson
a4a54aa1bf [libpng16] Imported from libpng-1.6.22beta02.tar 2016-02-08 17:13:06 -06:00
John Bowler
e717842a54 pngstest: options to fix per-file seed
Also avoid command output substition in tests/pngstest and fix the collation
locale to ASCII/C/POSIX

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-28 23:10:04 -08:00
John Bowler
98c6fa2495 PNG_IMAGE_PNG_SIZE_MAX error correction
The macro underreported the size (by up to 512 bytes) of an 8-bit non-color
palette based memory format because it failed to take into account that the
memory palette has to be expanded to full RGB when it is written to PNG.

This is not likely to be a serious bug because the macro is new, the memory
format in question is likely to be rarely used and the result of an undersized
buffer fails in a safe way.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-27 16:22:51 -08:00
John Bowler
ac796d3f9a Only use exit(77) in configure builds
Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-26 17:55:39 -08:00
Glenn Randers-Pehrson
f6a23fe205 [libpng16] Imported from libpng-1.6.22beta01.tar 2016-01-23 14:06:39 -06:00
Glenn Randers-Pehrson
93a3bc7343 [libpng16] Revised workaround for Coverity issue in pngvalid.c 2016-01-23 10:09:18 -06:00
John Bowler
7f576964d8 pngunknown.c: handle unknown IDAT
This is the test backported from 1.7 to ensure that when treating IDATs as
unknown the test does not fail if there are more than one IDAT chunks in the
file.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 19:19:14 -08:00
Glenn Randers-Pehrson
94f4e972b5 Merge branch 'libpng16-simple-memory-II' of git://github.com/jbowler/libpng-1 into libpng16 2016-01-18 12:43:36 -06:00
John Bowler
175a126a1a 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 09:53:38 -08:00
Glenn Randers-Pehrson
95d2726ecc [libpng16] Update change dates in pngvalid.c and pngfix.c 2016-01-18 09:24:23 -06:00
Glenn Randers-Pehrson
b8dbd78de8 [libpng16] Updated CHANGES, ANNOUNCE, and copyright notice in pngunknown.c 2016-01-18 09:09:33 -06:00
John Bowler
777dbf46dc 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 05:08:27 -08:00
Glenn Randers-Pehrson
e8558d2160 [libpng16] Changed PNG_USE_MKSTEMP to __COVERITY__ to select alternate
"tmpfile()" implementation in contrib/libtests/pngstest.c
2016-01-17 16:08:39 -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
780079e771 [libpng16] Worked around a false-positive Coverity issue in pngvalid.c. 2016-01-13 09:50:41 -06:00
John Bowler
b416dc5fc8 Mark 'limit' UNUSED in transform_range_check
Only affects release builds

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-06 12:58:01 -08:00
Glenn Randers-Pehrson
ecc022ee5f [libpng16] Bump version to libpng-1.6.21rc02.tar 2016-01-06 13:26:32 -06:00
Glenn Randers-Pehrson
092b8d7bf3 [libpng16] Imported from libpng-1.6.21rc01.tar 2016-01-04 08:24:14 -06:00
Glenn Randers-Pehrson
66db757dd4 [libpng16] Happy 2016! Updated copyright year 2016-01-02 13:40:27 -06:00
Glenn Randers-Pehrson
42b438b7dc [libpng16] Update CHANGES and ANNOUNCE 2015-12-17 20:51:13 -06:00
John Bowler
18765d0032 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:53:08 -08:00
Glenn Randers-Pehrson
4aa590288b [libpng16] Updated CHANGES and ANNOUNCE 2015-12-15 12:55:56 -06:00
John Bowler
2225ca0a54 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:28:47 -08:00
Glenn Randers-Pehrson
32629bb522 [libpng16] Update CHANGES and ANNOUNCE 2015-12-13 20:35:15 -06:00
Glenn Randers-Pehrson
0bc972fbc2 [libpng16] Fix typo in "last-changed" date. 2015-12-13 20:19:36 -06:00
John Bowler
6cc84b3c44 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:00:41 -08:00
John Bowler
c5e81c51d9 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 17:15:02 -08:00
John Bowler
cbe5d34f6f Backport pngvalid.c from libpng17
One fix is required for libpng16 LE, more for libpng16 BE

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 17:07:36 -08:00
Glenn Randers-Pehrson
0de0101fdd [libpng16] Bump version to 1.6.21beta01 2015-12-08 22:19:15 -06:00
Glenn Randers-Pehrson
5b6a6f914b [libpng16] Imported from libpng-1.6.20.tar 2015-12-02 22:30:37 -06:00
Glenn Randers-Pehrson
030e12ec39 [libpng16] Bump version to libpng-1.6.20rc02.tar 2015-11-29 16:10:46 -06:00
Glenn Randers-Pehrson
e7092bc59c [libpng16] Imported from libpng-1.6.20rc01.tar 2015-11-26 07:04:24 -06:00
Glenn Randers-Pehrson
87049cbf84 [libpng16] Update CHANGES, ANNOUNCE, minor editing of contrib/*/*.c 2015-11-25 15:55:01 -06:00
John Bowler
f5778c8fbb Fix error in handling of bad zlib CMINFO field
Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-25 12:59:42 -08:00
Glenn Randers-Pehrson
92ec30a3b1 [libpng16] Imported from libpng-1.6.20beta03.tar 2015-11-24 09:34:02 -06:00
John Bowler
8a08b6457a Test backport
Tests backported from the multi-version compatible ones in libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 20:15:51 -08: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
6ca8ee1518 [libpng16] Imported from libpng-1.6.19beta04.tar 2015-10-14 22:25:21 -05:00
John Bowler
2163c930b0 pow and sbit fixes backported to pngvalid from 1.7
Signed-off-by: John Bowler <jbowler@acm.org>
2015-10-03 11:14:43 -07:00
John Bowler
04402a9126 Fix (work round) rgb-to-gray issues in libpng 1.6
The previous attempts to ignore the errors in the code aren't quite enough to
deal with the 'channel selection' encoding added to libpng 1.7; abort.
pngvalid.c is changed to drop this encoding in prior versions.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-26 17:41:02 -07:00
John Bowler
956f295d48 Merge remote-tracking branch 'local/libpng16' into libpng16 2015-09-25 16:58:43 -07:00
Glenn Randers-Pehrson
61257bc2de [libpng16] Update CHANGES and ANNOUNCE 2015-09-25 18:25:08 -05:00
John Bowler
6297297708 Enable low-bit-depth gray tests in pngvalid
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 16:21:45 -07:00
John Bowler
fd42ef9b06 pngstest 1.6 error limit and warning revisions
Remove the '--strict' in 1.6 because of the double-gamma-correction warning,
update pngstest-errors.h for the errors detected with the new contrib/testspngs
PNG test files.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 13:40:18 -07:00
John Bowler
a2671a7f49 test PNG files (contrib/testpngs)
Back ported from libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 13:10:13 -07:00
Glenn Randers-Pehrson
01a0e8062d [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()
functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha()
which now work properly with 16-bit images.
2015-09-24 22:39:53 -05:00
Glenn Randers-Pehrson
efe4e5d10d [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit
input that was made in version 1.6.17beta01, to preserve legacy
behavior even though it was incorrect.  Instead, added new API
png_set_filter_16() and png_set_add_alpha_16() that set a flag to
make png_do_read_filter() interpret the filler bytes properly.
2015-09-23 22:08:04 -05:00
John Bowler
d6eb4b71ac Updated pngstest-errors.h
This update incorporates errors resulting from the more extensive image test
suite used in libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-20 20:59:10 -07:00
Glenn Randers-Pehrson
4c9c43d4d4 [libpng16] Added license info to pngstest-errors.h and its generator. 2015-09-19 20:17:44 -05:00
Glenn Randers-Pehrson
0cc11b86ba [libpng16] Update ANNOUNCE and CHANGES with recent pngstest updates. 2015-09-19 19:57:59 -05:00
John Bowler
93b4568fc0 pngstest: make error limits version specific
Splitting the machine generated error structs out to a file allows the values to
be updated without changing pngstest.c itself, since libpng 1.6 and 1.7 have
slightly different error limits this simplifies maintenance.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-19 16:34:30 -07:00
Glenn Randers-Pehrson
8bfcb4c7a7 [libpng16] Copied contrib/libtests/pngvalid.c from libpng17. 2015-09-18 14:24:49 -05:00
Glenn Randers-Pehrson
eb0bf4f468 [libpng16] Updated pngvalid.c with recent changes from libpng17 2015-09-18 13:09:57 -05:00
John Bowler
e8c554661c Back-port pngvalid corrections and enhancements
This is a patch for libpng16.
It incorporates fixes to the low-bit-depth gray background handling from
libpng17 and turns one of the low-bit-depth gray cases that does work (and,
indeed, did work before) in libpng16

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-17 07:56:30 -07:00
John Bowler
c3e7e7d715 [libpng16] tests backported from libpng 1.7
This updates libpng16 with all the test changes from libpng17,
including changes to pngvalid.c to ensure that the original,
distributed, version of contrib/visupng/cexcept.h can be used.

pngvalid contains the correction to the use of SAVE/STORE_
UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7.  More
tests contain the --strict option to detect warnings and the
pngvalid-standard test has been corrected so that it does not
turn on progresive-read (there is a separate test which does
that.)

Some signed/unsigned fixes have been made.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-15 15:38:52 -07:00
Glenn Randers-Pehrson
1e16e8829d [libpng16] Fix typo (extra "*/") in contrib/libtests/fakepng.c 2015-09-15 17:07:34 -05:00
Glenn Randers-Pehrson
4c02a5930a [libpng16] Imported from libpng-1.6.19beta02.tar 2015-08-19 12:58:14 -05:00
Glenn Randers-Pehrson
8b83ff3704 [libpng16] Change "n bit" to "n-bit" in comments. 2015-08-13 20:57:18 -05:00
Glenn Randers-Pehrson
67806d44c1 [libpng16] Imported from libpng-1.6.19beta01.tar 2015-07-30 11:18:15 -05:00
Glenn Randers-Pehrson
8510247b5f [libpng16] Fixed uninitialized variable in contrib/gregbook/rpng2-x.c and
fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c
2015-07-30 11:16:29 -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
a390897ba4 [libpng16] Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
Removed some useless typecasts from contrib/tools/png-fix-itxt.c
2015-07-01 14:06:39 -05:00
Glenn Randers-Pehrson
9d4ea3014b [libpng16] Imported from libpng-1.6.18beta08.tar 2015-06-30 10:54:44 -05:00
Glenn Randers-Pehrson
c6f629ffdd [libpng16] Unlink temporary file immediately in pngstest (PNG_USE_MKSTEMP) 2015-06-11 16:28:54 -05:00
Glenn Randers-Pehrson
f6e7551f06 [libpng16] Eliminated the final two Coverity defects (insecure temporary file
handling in contrib/libtests/pngstest.c; possible overflow of
unsigned char in contrib/tools/png-fix-itxt.c). To use the "secure"
file handling, define PNG_USE_MKSTEMP, otherwise "tmpfile()" will
continue to be used.
2015-06-10 07:05:18 -05:00
Glenn Randers-Pehrson
867f2ec058 [libpng16] Imported from libpng-1.6.18beta07.tar 2015-06-06 17:03:14 -05:00
Glenn Randers-Pehrson
b26b51d154 [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.
2015-06-03 16:07:01 -05:00
Glenn Randers-Pehrson
f50b593ac0 [libpng16] Update revision information in cexcept.h as required by the license. 2015-06-03 15:41:46 -05:00
John Bowler
b780eba4e4 [libpng16] Fixed cexcept.h in which GCC 5 now reports that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp.
2015-06-03 14:46:34 -05:00
Glenn Randers-Pehrson
b66de48b3b [libpng16] Changed png_voidcast(), etc., to voidcast(), etc., in
contrib/tools/pngfix.c to avoid confusion with the libpng private macros.
2015-05-30 22:57:33 -05:00
Glenn Randers-Pehrson
d8d18fbb02 [libpng16] Imported from libpng-1.6.18beta03.tar 2015-05-06 16:39:31 -05:00
John Bowler
74428df2fd [libpng16] Improved DIV65535 algorithm in simpleover.c. By experiment,
(x + (x>>16) + 32769) works as well as the previous form and avoids one shift.
2015-05-06 11:41:17 -05:00
Glenn Randers-Pehrson
d6b1375bf5 [libpng16] Trivial editing of comments in contrib/examples/simpleover.c 2015-05-04 20:25:31 -05:00