[libpng16] Choose to use windowBits==15 or the zlib header setting via the

benign-errors setting.  If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
This commit is contained in:
Glenn Randers-Pehrson 2013-05-07 13:48:48 -05:00
parent f02bb98fdf
commit ec89c54e42
3 changed files with 41 additions and 26 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.16beta05 - May 2, 2013 Libpng 1.6.3beta05 - May 7, 2013
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -9,44 +9,48 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
1.5.16beta05.tar.xz (LZMA-compressed, recommended) 1.6.3beta05.tar.xz (LZMA-compressed, recommended)
1.5.16beta05.tar.gz 1.6.3beta05.tar.gz
1.5.16beta05.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp1516b05.7z (LZMA-compressed, recommended) lp163b05.7z (LZMA-compressed, recommended)
lp1516b05.zip lp163b05.zip
Other information: Other information:
1.5.16beta05-README.txt 1.6.3beta05-README.txt
1.5.16beta05-LICENSE.txt 1.6.3beta05-LICENSE.txt
Changes since the last public release (1.5.15): Changes since the last public release (1.6.2):
Version 1.5.16beta01 [April 25, 2013] Version 1.6.3beta01 [April 25, 2013]
Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c Revised stack marking in arm/filter_neon.S and configure.ac.
(Flavio Medeiros).
Revised stack marking in arm/filter_neon.S and configure.ac
Ensure that NEON filter stuff is completely disabled when switched 'off'. Ensure that NEON filter stuff is completely disabled when switched 'off'.
Previously the ARM NEON specific files were still built if the option Previously the ARM NEON specific files were still built if the option
was switched 'off' as opposed to being explicitly disabled. was switched 'off' as opposed to being explicitly disabled.
Avoid a compiler warning about unused png_ptr in translate_gamma_flags()
Version 1.5.16beta02 [April 26, 2013] Version 1.6.3beta02 [April 26, 2013]
Revise pngtest.c to skip tests of unsupported features.
Regenerated configure files.
Version 1.5.16beta03 [April 26, 2013]
Test for 'arm*' not just 'arm' in the host_cpu configure variable. Test for 'arm*' not just 'arm' in the host_cpu configure variable.
Rebuilt the configure scripts.
Version 1.5.16beta04 [May 1, 2013] Version 1.6.3beta03 [April 30, 2013]
Expanded manual paragraph about writing private chunks, particularly Expanded manual paragraph about writing private chunks, particularly
the need to call png_set_keep_unknown_chunks() when writing them. the need to call png_set_keep_unknown_chunks() when writing them.
Avoid dereferencing NULL pointer possibly returned from
png_create_write_struct() (Andrew Church).
Version 1.5.16beta05 [May 2, 2013] Version 1.6.3beta04 [May 6, 2013]
Calculate our own zlib windowBits when decoding rather than trusting the
CMF bytes in the PNG datastream.
Version 1.6.3beta05 [May 7, 2013]
Choose to use windowBits==15 or the zlib header setting via the
benign-errors setting. If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4528,10 +4528,12 @@ Version 1.6.3beta04 [May 6, 2013]
Calculate our own zlib windowBits when decoding rather than trusting the Calculate our own zlib windowBits when decoding rather than trusting the
CMF bytes in the PNG datastream. CMF bytes in the PNG datastream.
Version 1.6.3beta05 [May 6, 2013] Version 1.6.3beta05 [May 7, 2013]
Choose to use our calculated windowBits or the zlib header setting via Choose to use windowBits==15 or the zlib header setting via the
the benign-errors setting. If benign errors are allowed, then ignore benign-errors setting. If benign errors are allowed, then ignore
the windowBits setting in the zlib header. the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4163,7 +4163,8 @@ png_read_finish_row(png_structrp png_ptr)
} }
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
#ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED #ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED
#if ZLIB_VERNUM > 0x1280
/* This is the code to to select a windowBits value to match the smallest /* This is the code to to select a windowBits value to match the smallest
* possible sliding window needed to contain the entire uncompressed image. * possible sliding window needed to contain the entire uncompressed image.
*/ */
@ -4230,6 +4231,7 @@ png_read_image_size(png_structrp png_ptr)
return 0xffffffffU; return 0xffffffffU;
} }
#endif /* ZLIB_VERNUM */
#endif /* PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED */ #endif /* PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED */
void /* PRIVATE */ void /* PRIVATE */
@ -4519,17 +4521,24 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
#ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED #ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED
/* To do in libpng17: get windowBits from the CMF bytes and select the /* To do in libpng17: get windowBits from the CMF bytes and select the
* smaller of that and the required_window_bits. Requires a one-byte * smaller of that and the required_window_bits. Requires a one-byte
* lookahead into the first IDAT chunk data. * lookahead into the first IDAT chunk data, and requires actually
* injecting the revised CMF bytes into the datastream before reading.
*/ */
{ {
#if ZLIB_VERNUM < 0x1290
unsigned int windowBits; unsigned int windowBits;
#endif /* ZLIB_VERNUM */
if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
{ {
#if ZLIB_VERNUM < 0x1290
windowBits=15;
#else
/* Compute required windowBits from the image size, pixel size, and /* Compute required windowBits from the image size, pixel size, and
* interlacing setting. * interlacing setting.
*/ */
windowBits=required_window_bits(png_read_image_size(png_ptr)); windowBits=required_window_bits(png_read_image_size(png_ptr));
#endif /* ZLIB_VERNUM */
} }
else else