[libpng17] Catch up with recent libpng16 changes; unknown handling and spelling

corrections
This commit is contained in:
John Bowler
2013-09-30 08:28:05 -05:00
committed by Glenn Randers-Pehrson
parent d9f60caf72
commit 7657ac14f2
15 changed files with 315 additions and 100 deletions

View File

@@ -2792,19 +2792,26 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
if (ret < 0)
png_chunk_error(png_ptr, "error in user chunk");
else if (ret > 0) /* chunk was handled */
else if (ret == 0)
{
/* Use the default handling, note that if there is per-chunk
* handling specified it has already been set into 'keep'.
*
* NOTE: this is an API change in 1.7.0, prior to 1.7.0 libpng
* would force keep to PNG_HANDLE_CHUNK_IF_SAFE at this point,
* and 1.6.0 would issue a warning if this caused a default of
* discarding the chunk to be changed.
*/
if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT)
keep = png_ptr->unknown_default;
}
else /* chunk was handled */
{
handled = 1;
/* Critical chunks can be safely discarded at this point. */
keep = PNG_HANDLE_CHUNK_NEVER;
}
/* else: use the default handling.
* NOTE: this is an API change in 1.7.0, prior to 1.7.0 libpng would
* force keep to PNG_HANDLE_CHUNK_IF_SAFE at this point, and 1.6.0
* would issue a warning if this caused a default of discarding the
* chunk to be changed.
*/
}
else
@@ -2892,9 +2899,8 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
}
# endif
}
# else /* no store support! */
# else /* no store support: the chunk must be handled by the user callback */
PNG_UNUSED(info_ptr)
# error untested code (reading unknown chunks with no store support)
# endif
/* Regardless of the error handling below the cached data (if any) can be