Disallow all-zero-length Huffman tables

This commit is contained in:
Alexey Knyazev
2021-10-24 01:59:32 +04:00
committed by GitHub
parent 646a9f8261
commit 52214ab28d

View File

@@ -160,7 +160,7 @@ namespace basist
next_code[i + 1] = (total = ((total + syms_using_codesize[i]) << 1));
}
if (((1U << basisu::cHuffmanMaxSupportedInternalCodeSize) != total) && (used_syms > 1U))
if (((1U << basisu::cHuffmanMaxSupportedInternalCodeSize) != total) && (used_syms != 1U))
return false;
for (int tree_next = -1, sym_index = 0; sym_index < (int)total_syms; ++sym_index)