[libpng16] Work around for duplicate row start calls; added warning messages.

This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
fails to call one of the 'start' routines (not enabled in libpng-1.5
because it is technically an API change, since it did normally work
before.)  It also makes duplicate calls to png_read_start_row (an
internal function called at the start of the image read) benign, as
they were before changes to use png_inflate_claim. Somehow webkit is
causing this to happen; this is probably a mis-feature in the zlib
changes so this commit is only a work-round.
This commit is contained in:
John Bowler
2012-03-18 14:39:41 -05:00
committed by Glenn Randers-Pehrson
parent f5dcba6b9b
commit 0c11b5f8e7
5 changed files with 78 additions and 9 deletions

View File

@@ -4105,6 +4105,17 @@ png_read_start_row(png_structrp png_ptr)
png_debug(1, "in png_read_start_row");
/* Because init_read_transformations, below, modifies values in png_struct
* it will not always work correctly if called twice. This error detects
* that condition but just warns, because it does tend to work most of the
* time.
*/
if (png_ptr->flags & PNG_FLAG_ROW_INIT)
{
png_warning(png_ptr, "unexpected duplicate call to png_read_start_row");
png_ptr->zowner = 0; /* release previous claim */
}
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
png_init_read_transformations(png_ptr);
#endif