Handle Z_BUF_ERROR in decompress_dynamic

(cherry picked from commit 293050a919)
This commit is contained in:
Haoyu Qiu 2021-07-11 11:05:12 +08:00 committed by Rémi Verschelde
parent a29b834930
commit 5a54cdf4fd
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -237,7 +237,10 @@ int Compression::decompress_dynamic(PoolVector<uint8_t> *p_dst, int p_max_dst_si
case Z_DATA_ERROR:
case Z_MEM_ERROR:
case Z_STREAM_ERROR:
WARN_PRINT(strm.msg);
case Z_BUF_ERROR:
if (strm.msg) {
WARN_PRINT(strm.msg);
}
(void)inflateEnd(&strm);
p_dst->resize(0);
return ret;