mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 06:16:04 +00:00
fix exception propagation on packet decompression
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user