fix exception propagation on packet decompression

This commit is contained in:
Lion Kortlepel
2024-09-19 16:58:04 +02:00
parent 530d605bc1
commit 73f494041a
4 changed files with 35 additions and 3 deletions

View File

@@ -418,7 +418,11 @@ std::vector<uint8_t> DeComp(std::span<const uint8_t> input) {
output_size = output_buffer.size();
} else if (res != Z_OK) {
beammp_error("zlib uncompress() failed: " + std::to_string(res));
throw std::runtime_error("zlib uncompress() failed");
if (res == Z_DATA_ERROR) {
throw InvalidDataError {};
} else {
throw std::runtime_error("zlib uncompress() failed");
}
} else if (res == Z_OK) {
break;
}