From 5357dd77f049697d86408337970bf99dea1ceb71 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Tue, 24 Nov 2015 17:18:46 -0800 Subject: [PATCH] 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 --- pngread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pngread.c b/pngread.c index a41ab3b18..acf013d4a 100644 --- a/pngread.c +++ b/pngread.c @@ -375,7 +375,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row) * typically be before the last row in the image. */ if (png_ptr->read_started && - png_ptr->interlaced == PNG_INTERLACE_NONE ? + (png_ptr->interlaced == PNG_INTERLACE_NONE ? png_ptr->row_number == png_ptr->height-1U : ( # ifdef PNG_READ_INTERLACING_SUPPORTED png_ptr->do_interlace ? @@ -385,7 +385,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row) PNG_LAST_PASS_ROW(png_ptr->row_number, png_ptr->pass, png_ptr->height) ) - ) + )) { png_app_error(png_ptr, "Too many calls to png_read_row"); return;