mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Fix inconsistent handling of invalid zlib data
In libpng 1.6 zlib initialization was changed to use the window size in the zlib stream, not a fixed value. This causes some invalid images, ones where CINFO is too large, to display 'correctly' if the rest of the data is valid. This provides a work-round for zlib versions where the error arises (ones that support the API change to use the window size in the stream). Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
@@ -1215,6 +1215,14 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
|
||||
/* Initialize the row buffers, etc. */
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
|
||||
|
||||
#if PNG_ZLIB_VERNUM >= 0x1240
|
||||
PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
|
||||
PNG_EMPTY);
|
||||
# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
|
||||
#else /* Zlib < 1.2.4 */
|
||||
# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush)
|
||||
#endif /* Zlib < 1.2.4 */
|
||||
|
||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||
/* Optional call to update the users info structure */
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr,
|
||||
|
||||
Reference in New Issue
Block a user