diff options
author | Paweł Fertyk <pfertyk@pfertyk.me> | 2021-05-25 18:43:26 +0200 |
---|---|---|
committer | Paweł Fertyk <pfertyk@pfertyk.me> | 2021-05-25 18:43:26 +0200 |
commit | ee8c9bb614368864e21391f9456f31943b4d3000 (patch) | |
tree | 2656670d49572ca838ca030a83f5c2010da813ff /core/variant | |
parent | f1abfbbeb11836dd1e680f02075f3655f1e0c2f0 (diff) |
Return error when decompressing empty PoolByteArray
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/variant_call.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index efaaa8cd19..063611d415 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -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); |