mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 20:43:45 +01:00
zstd: Fix minetest.decompress lockup when data ends too early
This commit is contained in:
parent
02db521c80
commit
5861192752
@ -262,6 +262,8 @@ void decompressZstd(std::istream &is, std::ostream &os)
|
|||||||
is.read(input_buffer, bufsize);
|
is.read(input_buffer, bufsize);
|
||||||
input.size = is.gcount();
|
input.size = is.gcount();
|
||||||
input.pos = 0;
|
input.pos = 0;
|
||||||
|
if (input.size == 0)
|
||||||
|
throw SerializationError("decompressZstd: data ended too early");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ZSTD_decompressStream(stream.get(), &output, &input);
|
ret = ZSTD_decompressStream(stream.get(), &output, &input);
|
||||||
|
Loading…
Reference in New Issue
Block a user