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>
This commit is contained in:
John Bowler
2015-11-22 21:37:16 -08:00
parent b69df74b8e
commit 6803b09cb7
4 changed files with 33 additions and 9 deletions

View File

@@ -4362,7 +4362,11 @@ png_read_process_IDAT(png_structrp png_ptr, png_bytep transformed_row,
# if defined(PNG_PROGRESSIVE_READ_SUPPORTED) ||\
defined(PNG_READ_INTERLACING_SUPPORTED)
if (png_ptr->transform_list != NULL &&
(save_row || (png_ptr->do_interlace && pass < 6U)))
(save_row
# ifdef PNG_READ_INTERLACING_SUPPORTED
|| (png_ptr->do_interlace && pass < 6U)
# endif /* READ_INTERLACING */
))
{
if (png_ptr->transformed_row == NULL)
png_ptr->transformed_row = png_voidcast(png_bytep,