[ibpng16] Added application error reporting and added chunk names to read

benign errors; also added --strict to pngstest - not enabled
yet because a warning is produced.
This commit is contained in:
John Bowler
2012-03-18 22:37:25 -05:00
committed by Glenn Randers-Pehrson
parent 66efa24241
commit 2bc76ffaf1
8 changed files with 100 additions and 18 deletions

View File

@@ -99,16 +99,19 @@ png_rtran_ok(png_structrp png_ptr, int need_IHDR)
if (png_ptr != NULL)
{
if (png_ptr->flags & PNG_FLAG_ROW_INIT)
png_error(png_ptr,
png_app_error(png_ptr,
"invalid after png_start_read_image or png_read_update_info");
if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) == 0)
png_error(png_ptr, "invalid before the PNG header has been read");
else if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) == 0)
png_app_error(png_ptr, "invalid before the PNG header has been read");
/* Turn on failure to initialize correctly for all transforms. */
png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED;
else
{
/* Turn on failure to initialize correctly for all transforms. */
png_ptr->flags |= PNG_FLAG_DETECT_UNINITIALIZED;
return 1; /* Ok */
return 1; /* Ok */
}
}
return 0; /* no png_error possible! */