ladybird/Tests/LibCompress
Idan Horowitz b749167506 LibCompress: Fix off-by-one error in generate_huffman_lengths
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.
2023-12-04 00:06:38 +01:00
..
brotli-test-files LibCompress: Brotli support metadata of skip_length=0 2022-10-11 22:49:33 -06:00
deflate-test-files LibCompress: Fix off-by-one error in generate_huffman_lengths 2023-12-04 00:06:38 +01:00
CMakeLists.txt LibCompress: Fix off-by-one error in generate_huffman_lengths 2023-12-04 00:06:38 +01:00
TestBrotli.cpp LibCompress: Let BrotliDecompressionStream take a MaybeOwned 2023-08-23 12:03:37 +01:00
TestDeflate.cpp LibCompress: Fix off-by-one error in generate_huffman_lengths 2023-12-04 00:06:38 +01:00
TestGzip.cpp Tests: Prefer TRY_OR_FAIL() and MUST() over EXPECT(!.is_error()) 2023-05-14 15:39:38 -06:00
TestLzma.cpp LibCompress: Handle arbitrarily long FF-chains in the LZMA encoder 2023-05-19 23:40:33 +02:00
TestXz.cpp LibCompress: Implement correct validation of last filters 2023-10-29 22:00:59 +01:00
TestZlib.cpp LibCompress: Port ZlibDecompressor to AK::Stream 2023-08-23 12:03:37 +01:00