mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Catch up with some recent changes that did not get merged.
This commit is contained in:
11
pngrutil.c
11
pngrutil.c
@@ -2766,6 +2766,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
png_debug(1, "in png_handle_unknown");
|
||||
|
||||
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||
/* NOTE: this code is based on the code in libpng-1.4.12 except for fixing
|
||||
* the bug which meant that setting a non-default behavior for a specific
|
||||
* chunk would be ignored (the default was always used unless a user
|
||||
@@ -2778,14 +2779,15 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
||||
* function.
|
||||
*/
|
||||
# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
keep = PNG_HANDLE_CHUNK_AS_DEFAULT;
|
||||
# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
|
||||
keep = png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* One of the following methods will read the chunk or skip it (at least one
|
||||
* of these is always defined because this is the only way to switch on
|
||||
* PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
*/
|
||||
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||
# ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||
/* The user callback takes precedence over the chunk keep value, but the
|
||||
* keep value is still required to validate a save of a critical chunk.
|
||||
@@ -2893,7 +2895,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
png_crc_finish(png_ptr, length);
|
||||
}
|
||||
# endif /* PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED */
|
||||
# endif
|
||||
|
||||
# ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
|
||||
/* Now store the chunk in the chunk list if appropriate, and if the limits
|
||||
@@ -2932,9 +2934,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