diff options
author | John Bowler <jbowler@acm.org> | 2010-12-19 06:22:23 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2010-12-19 06:22:23 -0600 |
commit | 660c6e4d70b8b7e688031e65f65b818ac99b5e8b (patch) | |
tree | 8becdd6260e0efbc4e59546cfe1021355dc9da86 /pngrutil.c | |
parent | 4c93a7cb6fad9692fcce27539209d90b02a7e234 (diff) | |
download | libpng-660c6e4d70b8b7e688031e65f65b818ac99b5e8b.tar.gz |
[devel] Fixed interlace image handling and add test cases (John Bowler)
Diffstat (limited to 'pngrutil.c')
-rw-r--r-- | pngrutil.c | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/pngrutil.c b/pngrutil.c index 6ff9a1e49..3f00de989 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -3293,15 +3293,12 @@ png_read_finish_row(png_structp png_ptr) png_pass_yinc[png_ptr->pass] - 1 - png_pass_ystart[png_ptr->pass]) / png_pass_yinc[png_ptr->pass]; - - if (!(png_ptr->num_rows)) - continue; } else /* if (png_ptr->transformations & PNG_INTERLACE) */ - break; + break; /* libpng deinterlacing sees every row */ - } while (png_ptr->iwidth == 0); + } while (png_ptr->num_rows == 0 || png_ptr->iwidth == 0); if (png_ptr->pass < 7) return; @@ -3614,55 +3611,4 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->flags |= PNG_FLAG_ROW_INIT; } - -#ifdef PNG_SEQUENTIAL_READ_SUPPORTED -int PNGAPI -png_get_num_passes(png_structp png_ptr) -{ - if (png_ptr != NULL) - { - if (png_ptr->interlaced) - return 7; - - else - return 1; - } - - /* Here on error */ - return 0; -} - -png_uint_32 PNGAPI -png_get_num_rows(png_structp png_ptr) -{ - if (png_ptr != NULL) - { - if (png_ptr->flags & PNG_FLAG_ROW_INIT) - return png_ptr->num_rows; - - else - png_error(png_ptr, "Call png_start_read_image or png_read_update_info " - "before png_get_num_rows"); - } - - /* Here on error */ - return 0; -} - -png_uint_32 PNGAPI -png_get_num_cols(png_structp png_ptr) -{ - if (png_ptr != NULL) - { - if (png_ptr->flags & PNG_FLAG_ROW_INIT) - return png_ptr->iwidth; - else - png_error(png_ptr, "Call png_start_read_image or png_read_update_info " - "before png_get_num_cols"); - } - - /* Here on error */ - return 0; -} -#endif /* SEQUENTIAL READ */ #endif /* PNG_READ_SUPPORTED */ |