From a8896be85ea332c0f5d6c7009e4f6e70133d1f6f Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 4 Aug 2011 21:52:26 +0200 Subject: COMMON: Initialize more z_stream fields before calling inflateInit2. The zlib documentation and examples claim this is needed, as spotted by LordHoto. --- common/zlib.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/zlib.cpp b/common/zlib.cpp index b047586af0..71a25bd951 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -76,6 +76,8 @@ public: _stream.zalloc = Z_NULL; _stream.zfree = Z_NULL; _stream.opaque = Z_NULL; + _stream.avail_in = 0; + _stream.next_in = Z_NULL; // Verify file header is correct w->seek(0, SEEK_SET); -- cgit v1.2.3