Add rails for huffman table log calculation (#3047)

This commit is contained in:
binhdvo
2022-02-02 15:12:48 -05:00
committed by GitHub
parent 529a5879bf
commit b9566fc558
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -3112,6 +3112,7 @@ static size_t ZSTD_buildBlockEntropyStats_literals(void* const src, size_t srcSi
/* Build Huffman Tree */
ZSTD_memset(nextHuf->CTable, 0, sizeof(nextHuf->CTable));
huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);
assert(huffLog <= LitHufLog);
{ size_t const maxBits = HUF_buildCTable_wksp((HUF_CElt*)nextHuf->CTable, countWksp,
maxSymbolValue, huffLog,
nodeWksp, nodeWkspSize);