Merge pull request #260 from lexaknyazev/patch-1

Disallow all-zero-length Huffman tables
This commit is contained in:
Rich Geldreich
2022-12-11 05:00:57 -05:00
committed by GitHub

View File

@@ -162,7 +162,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)