mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #49073 from pfertyk/issue-49006-packedbytearray-decompress-crashes-godot
Return error when decompressing empty PackedByteArray
This commit is contained in:
commit
b6f381475f
@ -611,6 +611,9 @@ struct _VariantCall {
|
||||
if (buffer_size <= 0) {
|
||||
ERR_FAIL_V_MSG(decompressed, "Decompression buffer size must be greater than zero.");
|
||||
}
|
||||
if (p_instance->size() == 0) {
|
||||
ERR_FAIL_V_MSG(decompressed, "Compressed buffer size must be greater than zero.");
|
||||
}
|
||||
|
||||
decompressed.resize(buffer_size);
|
||||
int result = Compression::decompress(decompressed.ptrw(), buffer_size, p_instance->ptr(), p_instance->size(), mode);
|
||||
|
Loading…
Reference in New Issue
Block a user