Fix gzip_decompressor in case of one chunk being exactly equal to buffer size (#636)

* add larget chunks test

* revert test

* Fix gzip decoder in case of chunk being equal to buffer size

* add test
This commit is contained in:
Ivan Fefer authored and GitHub committed 2020-09-03 12:20:02 -04:00
1 parent 69e75f4a67
commit 3b5bab3308
2 files changed
+45 -2

No files matched your search

+2 -2
View File
@@ -2267,7 +2267,7 @@ public:
strm_.next_in = const_cast<Bytef *>(reinterpret_cast<const Bytef *>(data));
std::array<char, 16384> buff{};
do {
while (strm_.avail_in > 0) {
strm_.avail_out = buff.size();
strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
@@ -2282,7 +2282,7 @@ public:
if (!callback(buff.data(), buff.size() - strm_.avail_out)) {
return false;
}
} while (strm_.avail_out == 0);
}
return ret == Z_OK || ret == Z_STREAM_END;
}