mirror of
https://github.com/RGBCube/serenity
synced 2025-10-29 05:32:34 +00:00
Previously we would calculate the index of the first parent node as heap.size() (which is initialized to non_zero_freqs), so in the edge case in which all symbols had a non-zero frequency, we would use the Size-index entry in the array for both the first symbol's leaf node, and the first parent node. The result would either be a non-optimal huffman code (bad), or an illegal huffman code that would then go on to crash due to an error check in CanonicalCode::from_bytes. (worse) We now store parent nodes starting at heap.size() - 1, which eliminates the potential overlap, and resolves the issue. |
||
|---|---|---|
| .. | ||
| Brotli.cpp | ||
| Brotli.h | ||
| BrotliDictionary.cpp | ||
| BrotliDictionary.h | ||
| BrotliDictionaryData.bin | ||
| CMakeLists.txt | ||
| Deflate.cpp | ||
| Deflate.h | ||
| DeflateTables.h | ||
| Gzip.cpp | ||
| Gzip.h | ||
| Lzma.cpp | ||
| Lzma.h | ||
| Lzma2.cpp | ||
| Lzma2.h | ||
| LZWDecoder.h | ||
| Xz.cpp | ||
| Xz.h | ||
| Zlib.cpp | ||
| Zlib.h | ||