Provide correct arguments to inflateInit2.
windowBits of 16 means "decode gzip header" and "use window size from zlib header". For some reason, this results in a window size that is too small on OpenBSD. Instead, use maximum window size explicitly, since there is no downside for doing so.
This commit is contained in:
parent
13695be03a
commit
3d7e9f5e7b
@ -36,8 +36,8 @@ std::string LoadStringFromGzip(const std::string &name) {
|
|||||||
stream.zalloc = Z_NULL;
|
stream.zalloc = Z_NULL;
|
||||||
stream.zfree = Z_NULL;
|
stream.zfree = Z_NULL;
|
||||||
stream.opaque = Z_NULL;
|
stream.opaque = Z_NULL;
|
||||||
ssassert(inflateInit2(&stream, /*decode gzip header*/16) == Z_OK,
|
const int windowBits = /*maximum window*/ 15 + /*decode gzip header*/16;
|
||||||
"Cannot start inflation");
|
ssassert(inflateInit2(&stream, windowBits) == Z_OK, "Cannot start inflation");
|
||||||
|
|
||||||
// Extract length mod 2**32 from the gzip trailer.
|
// Extract length mod 2**32 from the gzip trailer.
|
||||||
std::string result;
|
std::string result;
|
||||||
|
Loading…
Reference in New Issue
Block a user