[devel] Fix png_get_current_row_number in the interlaced case.

This commit is contained in:
John Bowler
2011-02-12 08:59:17 -06:00
committed by Glenn Randers-Pehrson
parent 9c69360e97
commit 5432c01ffd
4 changed files with 23 additions and 2 deletions

View File

@@ -3072,7 +3072,13 @@ progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass)
* us the y in the sub-image:
*/
if (dp->do_interlace && dp->interlace_type == PNG_INTERLACE_ADAM7)
{
if (pass != png_get_current_pass_number(pp))
png_error(pp, "png_get_current_pass_number is broken");
y = PNG_ROW_FROM_PASS_ROW(y, pass);
if (y != png_get_current_row_number(pp))
png_error(pp, "png_get_current_row_number is broken");
}
/* Validate this just in case. */
if (y >= dp->h)