[libpng16] Fixed bug introduced in libpng-1.6.0beta28 that causes libpng to

handle chunks even when they have been tagged PNG_HANDLE_CHUNK_NEVER.
This commit is contained in:
Glenn Randers-Pehrson
2013-03-01 20:04:06 -06:00
parent 1118d6d985
commit 96cf4bde0e
4 changed files with 20 additions and 15 deletions

View File

@@ -2804,21 +2804,22 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
{
/* If the keep value is 'default' or 'never' override it, but
* still error out on critical chunks unless the keep value is
* 'always' While this is weird it is the behavior in 1.4.12. A
* possible improvement would be to obey the value set for the
* 'always' While this is weird it is the behavior in 1.4.12.
* A possible improvement would be to obey the value set for the
* chunk, but this would be an API change that would probably
* damage some applications.
*
* The png_app_warning below catches the case that matters, where
* the application has neither set specific save for this chunk
* or global save.
* the application has not set specific save or ignore for this
* chunk or global save or ignore.
*/
if (keep < PNG_HANDLE_CHUNK_IF_SAFE)
if (keep < PNG_HANDLE_CHUNK_NEVER)
{
# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
if (png_ptr->unknown_default < PNG_HANDLE_CHUNK_IF_SAFE)
png_app_warning(png_ptr,
"forcing save of an unhandled chunk; please call png_set_keep_unknown_chunks");
"forcing save of an unhandled chunk;"
" please call png_set_keep_unknown_chunks");
# endif
keep = PNG_HANDLE_CHUNK_IF_SAFE;
}