2314 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
c46bd30b51 [libpng17] Updated manual to require png_set_PLTE() to precede png_set_tRNS()
and png_set_hIST() if either is present.
2015-12-01 11:13:44 -06:00
Glenn Randers-Pehrson
cb3402221b [libpng17] Updated PNG_ZBUF_SIZE definition in scripts/pnglibconf.h.prebuilt 2015-11-30 17:50:39 -06:00
Glenn Randers-Pehrson
8978eba436 [libpng17] Update CHANGES and ANNOUNCE, update dates in png.c and png.h 2015-11-30 16:57:23 -06:00
John Bowler
4792c8a751 compression code unification
Unify the compression code so that inflate calls are localized to a common
routine.  Ground work for filter selection support.  Minor API changes to use
void* not byte* for data parameters.  Unification of some of the compression
code with the decompression code; IDAT_size replaces IDAT_read_size and
zbuffer_size, IDAT reading and writing is no longer controlled by the size of
the compression buffer.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-30 13:39:49 -08:00
John Bowler
6bbc74d880 pngunknown fix for multiple IDAT chunks
Fixes the case where IDAT is treated as unknown and saved; the first IDAT chunk
ends up 'before' IDAT, the rest 'after', pngunknown has to take this into
account since it checks before and after.
2015-11-28 08:42:54 -08:00
John Bowler
b3a18efebf Filter code change prep.
This commit moves code round and changes the filter write interfaces that took
png_uint_32 buffer pixel counts to unsigned int.  Also moves compression code
and definitions into pngwutil.c so that the compression code is isolated from
other definitions.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-27 15:42:52 -08:00
John Bowler
14d11b9f35 contrib space removal
Remove all trailing spaces from source files in contrib

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-26 09:55:37 -08:00
John Bowler
e41820cd0b Merge branch 'libpng17' into libpng17-20151124.0001 2015-11-25 16:08:20 -08:00
John Bowler
18211df70b [libpng17] Fix CMINFO bug in contrib/tools/pngfix.c 2015-11-25 16:03:47 -06:00
John Bowler
1775bdeb24 Better filter checking
Improve pngvalid coverage of filter combinations, remove the (new in 1.7) code
which disabled previous-row filters on the first row of an image in some cases.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-24 22:24:18 -08:00
John Bowler
8bffb48bc1 Add new pngvalid test case
This tests the 'size' images in the sequential reader, the existing test case
only uses the progressive reader which means that important parts of the filter
code never got tested.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-24 21:45:10 -08:00
Glenn Randers-Pehrson
edec44bfc4 [libpng17] Update CHANGES and ANNOUNCE 2015-11-24 20:45:26 -06:00
John Bowler
1c514557b6 Merge branch 'libpng17' of ../../libpng into libpng17 2015-11-24 18:17:31 -08:00
John Bowler
85d7eca204 Fix first row init on read.
The code failed to zero out the row buffer at the start of a pass where the AVG
filter is used because 'row_number' is not always zero (on interlaced images)
and, apparently, the assertion that the buffer had been zeroed when allocated
was not always correct for non-interlaced images.  Revealed by pngvalid --size
with a hack to make it always use AVG.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-24 17:56:06 -08:00
John Bowler
5357dd77f0 Fix significant bracketing problem
This error prevents the read of non-interlaced PNG files with height 1.  A
simple bracket problem caused by hasty multiple edits.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-24 17:18:46 -08:00
Glenn Randers-Pehrson
5db709d83c [libpng17] Updated CHANGES and ANNOUNCE, removed trailing blanks from *.c *.h 2015-11-24 14:38:52 -06:00
Glenn Randers-Pehrson
616ed1197b [libpng17] Bump version to 1.7.0beta70 2015-11-24 13:37:41 -06:00
Glenn Randers-Pehrson
0cb0a45721 [libpng17] Imported from libpng-1.7.0beta69.tar v1.7.0beta69 2015-11-24 09:51:46 -06:00
Glenn Randers-Pehrson
f476f13488 [libpng17] Updated CHANGES and ANNOUNCE 2015-11-23 21:44:18 -06:00
John Bowler
8d93ec2eca pngvalid fixes and backward compat
This fix is to the PNG_MAX_GAMMA_8 handling and png_set_rgb_to_gray, which had
bugs which were likely to expose end cases of rgb-to-gray conversion errors.
This might explain some of the machine math dependencies we are seeing
(*might*).

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 18:45:28 -08:00
John Bowler
b0076faf1f Backward compatibility with 1.6
1.6 did not define PNG_READ_PNG_SUPPORTED, ever; it doesn't matter there.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 18:14:57 -08:00
John Bowler
fa86bd2a61 Backward compatibility for pngtest.c
This version can be used in 1.6 and 1.5 with appropriate changes to the last
line.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 18:13:39 -08:00
John Bowler
961d60b067 Correct end-of-image test in pngread.c
This only changes the detection of invalid application behavior (too many calls
to png_read_row) from an affirm to a png_app_error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 18:12:17 -08:00
John Bowler
764ae07652 Merge branch 'libpng17' into libpng17-buffer-enhancements 2015-11-22 21:40:13 -08:00
John Bowler
6803b09cb7 Fixes for !READ_INTERLACE/!READ_PNG interpendencies
The reliance of png_read_png on interlace handling and some minor issues in the
test programs where they failed to correctly check for interlace handling were
exposed by the ability to write interlaced images even if WRITE_INTERLACING is
turned off.  This is fixed here.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 21:37:16 -08:00
Glenn Randers-Pehrson
7a7e4367d0 [libpng17] Updated CHANGES and ANNOUNCE 2015-11-22 23:16:01 -06:00
John Bowler
b69df74b8e Re-remove PNG_WRITE_INTERLACE
Previous change backed out.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 20:48:23 -08:00
John Bowler
a42416de9c Merge branch 'libpng17' into libpng17-buffer-enhancements 2015-11-22 20:43:56 -08:00
Glenn Randers-Pehrson
e51652b4db [libpng17] Reverted 12 -> 12U again. 2015-11-22 22:41:10 -06:00
Glenn Randers-Pehrson
771eb7d01e [libpng17] Update CHANGES, ANNOUNCE, pnglibconf.h.prebuilt 2015-11-22 22:35:35 -06:00
John Bowler
368bb1b241 Fix certain minimal config builds
The removal of png_struct::row_buffer and png_struct::row_format from write
builds configured without filter or transform support (respectively) wasn't
complete; some of the png.c and pngwrite.c cleanup code needed to handle the
potentially removed members.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 20:34:00 -08:00
John Bowler
504ebd427d Back out READ/WRITE_INTERLACING changes
Now that the code works consistently so that these just switch off the support
for having libpng do the interlace/deinterlace the old names make more sense,
restoring them avoids cruft in the configuration file and avoids an unnecessary
version specific change.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 20:25:24 -08:00
John Bowler
caa716d859 Fix build break introduced from libpng17
12->12U in a compare when the other side is signed.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 19:52:12 -08:00
John Bowler
0f2554a5e6 Squashed commit of the following:
commit fc4b42b1d56f95efeb1b9fe42dc35b7d98d246bb
Merge: 74516c7 9eb1413
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 19:37:54 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 74516c7257f1a28a69985684c5673caa390c700a
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 19:32:43 2015 -0800

    Make check full pass on gcc/g++ x86_64

    Signed-off-by: John Bowler <jbowler@acm.org>

commit e891e34737fc0bc9ee873a5d56b83c1e777b990c
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 12:01:37 2015 -0800

    Checkpoint: write buffering changes

    This version fails in pngvalid --size because of an error handling very narrow
    images, otherwise a standard build passes make check.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 457a046ebdab737eefb477126cf855e49df6de50
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 06:39:36 2015 -0800

    Fix previous bad merge

commit b4f426c97267317637d43f41fe0b05d1659bc63d
Merge: 07b9b90 a3458a6
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 06:32:34 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 07b9b90dfd653b744dbc3710b096facf6b4605f6
Merge: ed43306 5592e0b
Author: John Bowler <jbowler@acm.org>
Date:   Sat Nov 21 17:07:23 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit ed43306599f7039a90187862db82273fca3a4c3d
Merge: 772aed7 d3c0359
Author: John Bowler <jbowler@acm.org>
Date:   Tue Nov 17 17:47:26 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 772aed72378df9c8fccc5a4594b095d02d410a9c
Merge: 73ae431 801608f
Author: John Bowler <jbowler@acm.org>
Date:   Mon Nov 16 14:26:38 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 73ae4316cb6db7d7f6756583a1c213c35ca4e3f4
Merge: 687e6e3 c09b3ab
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 15 09:31:30 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 687e6e393e9d0220c2a12ec474aa01b83c5e9f25
Merge: fedd6da e916d9b
Author: John Bowler <jbowler@acm.org>
Date:   Thu Nov 5 08:45:14 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit fedd6da8798a14b2e002b0bc1379f5a09a03598a
Merge: 2e2fc5f ea41fd2
Author: John Bowler <jbowler@acm.org>
Date:   Tue Nov 3 21:05:01 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 2e2fc5f6d7678b710c52b7ea081ac4add677d8d5
Merge: 990d5f8 5b05197
Author: John Bowler <jbowler@acm.org>
Date:   Mon Oct 12 08:28:30 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 990d5f88688635dc0888657b689e30ffe7e7a7b3
Author: John Bowler <jbowler@acm.org>
Date:   Sun Oct 4 17:04:53 2015 -0700

    Read row buffer changes

    The read code now allocates one row buffer of the size of the input PNG row and,
    only if required, one buffer of the size of the output.

    The output buffer is required for the progressive reader (always) and for the
    sequential reader if libpng is de-interlacing an image (because the output row
    is used multiple times if png_read_row is called with a display row parameter.)

    This should reduce memory utilization by libpng significantly, but it has no
    detectable effect on overall performance figures of the test programs, these are
    probably dominated by memory allocations for the whole image within the test
    programs.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 527bf989bf0e30440f9e07a5544a6ebb1d6fd039
Merge: 50ebbc2 9099254
Author: John Bowler <jbowler@acm.org>
Date:   Sat Oct 3 13:39:17 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 50ebbc2c9a24cf1a6b428db53d55fbd5af4d6be6
Merge: 21a7f40 2cd6d56
Author: John Bowler <jbowler@acm.org>
Date:   Sat Oct 3 11:16:32 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 21a7f401ab40c79ead9e35882a8066e2cf1d6902
Merge: b512e1c 15a143e
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 19:01:23 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit b512e1c2c5bfe6df8b6dca32f862d325ec22115e
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:33:34 2015 -0700

    Transform rewrite: perform transforms in small chunks

    The intent of this change is to reduce the memory footprint during transform
    sequences by performing transforms in fixed (small) sized blocks of pixels.
    The change is incomplete; the filter code still works row-by-row, so the whole
    tranform also works row-by-row, the intent is to fix this so that everything
    works in small(ish) chunks.

    At present the change has no discernable effect on pngvalid --speed or pngstest
    with (e.g.) rgb-8-1.8.png; user time and (minor) page faults are the same in old
    and new versions.  The same applies to real-world 15MP PNG images; even on these
    the presence of the filter code causes a cyclical progress through memory which
    will interfere with any caching otherwise possible (useful word, 'otherwise'.)

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 781cb3699b92beb0e6bc5e03cef8fba820267082
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:12:53 2015 -0700

    Fix NO_WRITE_INTERLACE in pngvalid.c

    The support for writing interlaced images directly from libpng 1.7 was
    unintentionally disabled (INTERLACE_LAST was defined incorrectly, excluding the
    interlaced images).  This obscured the fact that the transform and error test
    case generators lacked the support for writing interlaced images from libpng.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 406ee2fd7946a384f1d7713712dc646080c5c52c
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:11:40 2015 -0700

    Add pngvalid --transform --interlace test

    This increases code coverage by generating test cases with smaller length rows
    as a result of the interlacing.  Without this packswap handling was incompletely
    tested.

    Signed-off-by: John Bowler <jbowler@acm.org>

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 19:41:41 -08:00
Glenn Randers-Pehrson
9eb14136d8 [libpng17] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr
not info_ptr.
2015-11-22 20:44:58 -06:00
Glenn Randers-Pehrson
09c90236f4 [libpng17] Refactored conditional compilation in png_init_row_info(). 2015-11-22 09:19:06 -06:00
Glenn Randers-Pehrson
a3458a6ba0 [libpng17] Refactor conditional compilation of png_get_compression_buffer_size()
for readability
2015-11-22 07:18:05 -06:00
Glenn Randers-Pehrson
daf4b9dd18 [libpng17] Clean up some conditional compilation of parts of statements
and fixed some indentation
2015-11-21 19:14:37 -06:00
Glenn Randers-Pehrson
3a866cb451 [libpng17] Avoid conditionally compiling parts of statements in png.c (suggested
by flaviommedeiros).
2015-11-21 18:18:26 -06:00
Glenn Randers-Pehrson
5592e0bc96 [libpng17] Use unsigned constants in pngrutil.c buffer length comparisons 2015-11-21 14:30:35 -06:00
John Bowler
57e92a8432 [libpng17] Use "1U" not "1" in pointer calculations in png_handle_sPLT(). 2015-11-19 21:13:29 -06:00
Glenn Randers-Pehrson
d3c0359b23 [libpng17] Removed a redundant new check in png_handle_pCAL(). 2015-11-17 16:14:35 -06:00
Glenn Randers-Pehrson
801608f8f4 [libpng17] Rearrange terms to make it self-evident that overflow cannot happen 2015-11-16 09:34:20 -06:00
Glenn Randers-Pehrson
c09b3ab2c7 [lbpng17] Avoid potential pointer overflow in png_handle_sPLT() and
png_handle_pCAL() (Bug report by John Regehr).
2015-11-13 22:25:03 -06:00
Glenn Randers-Pehrson
722645fec5 [libpng17] Bump version to 1.7.0beta69 2015-11-13 10:19:36 -06:00
Glenn Randers-Pehrson
f72d0d01eb [libpng17] Imported from libpng-1.7.0beta68.tar v1.7.0beta68 2015-11-12 07:13:47 -06:00
Glenn Randers-Pehrson
97c4072cce [libpng17] Clean up coding style in png_set_PLTE() 2015-11-05 11:20:12 -06:00
Glenn Randers-Pehrson
7a92725e17 [libpng17] Update ANNOUNCE and CHANGES 2015-11-05 07:06:01 -06:00
Glenn Randers-Pehrson
e916d9bb60 [libpng17] Fixed new bug with CRC error after reading an over-length palette. 2015-11-04 23:49:01 -06:00
Glenn Randers-Pehrson
ea41fd2161 [libpng17] Bump version to 1.7.0beta68 2015-11-03 09:55:12 -06:00