summaryrefslogtreecommitdiff
path: root/pngpread.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2015-11-27 23:57:39 -0800
committerJohn Bowler <jbowler@acm.org>2015-11-27 23:57:39 -0800
commit28a1cdfc2ed07d7c1af803dd98a50550699c847c (patch)
treeab5c1d3ac9a122c5ab863cfd9b804f415818472c /pngpread.c
parent87049cbf84d33fe0495b9dd8c61c4917067449b6 (diff)
downloadlibpng-28a1cdfc2ed07d7c1af803dd98a50550699c847c.tar.gz
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>
Diffstat (limited to 'pngpread.c')
-rw-r--r--pngpread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pngpread.c b/pngpread.c
index 076084a55..89ffc4018 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -662,7 +662,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
* change the current behavior (see comments in inflate.c
* for why this doesn't happen at present with zlib 1.2.5).
*/
- ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH);
+ ret = PNG_INFLATE(png_ptr, Z_SYNC_FLUSH);
/* Check for any failure before proceeding. */
if (ret != Z_OK && ret != Z_STREAM_END)