Check if dict is empty before reading first byte
diff --git a/lib/common/entropy_common.c b/lib/common/entropy_common.c
index acd9669..6625a80 100644
--- a/lib/common/entropy_common.c
+++ b/lib/common/entropy_common.c
@@ -168,9 +168,11 @@
{
U32 weightTotal;
const BYTE* ip = (const BYTE*) src;
- size_t iSize = ip[0];
+ size_t iSize;
size_t oSize;
+ if (!srcSize) return ERROR(srcSize_wrong);
+ iSize = ip[0];
/* memset(huffWeight, 0, hwSize); *//* is not necessary, even though some analyzer complain ... */
if (iSize >= 128) { /* special header */