mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Catch up with recent libpng16 changes; unknown handling and spelling
corrections
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
d9f60caf72
commit
7657ac14f2
26
pngrutil.c
26
pngrutil.c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user