mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Return error when decompressing empty buffer
This commit is contained in:
parent
8d06dd4371
commit
f563cabb4e
1 changed files with 4 additions and 0 deletions
|
@ -631,6 +631,10 @@ struct _VariantCall {
|
|||
r_ret = decompressed;
|
||||
ERR_FAIL_MSG("Decompression buffer size must be greater than zero.");
|
||||
}
|
||||
if (ba->size() == 0) {
|
||||
r_ret = decompressed;
|
||||
ERR_FAIL_MSG("Compressed buffer size must be greater than zero.");
|
||||
}
|
||||
|
||||
decompressed.resize(buffer_size);
|
||||
int result = Compression::decompress(decompressed.write().ptr(), buffer_size, ba->read().ptr(), ba->size(), mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue