diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 23713e4bfc9..5398c5a2970 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -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);