1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 13:07:42 +00:00
serenity/Userland/Libraries/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.cpp LibCompress: Let BrotliDecompressionStream take a MaybeOwned 2023-08-23 12:03:37 +01:00
Brotli.h LibCompress: Let BrotliDecompressionStream take a MaybeOwned 2023-08-23 12:03:37 +01:00
BrotliDictionary.cpp Everywhere: Add support for compilation under emscripten 2022-11-26 02:23:15 +03:30
BrotliDictionary.h LibCompress: Implement Brotli decompressor 2022-05-21 22:41:40 +02:00
BrotliDictionaryData.bin LibCompress: Implement Brotli decompressor 2022-05-21 22:41:40 +02:00
CMakeLists.txt LibCompress: Add support for XZ 2023-03-21 10:25:13 +01:00
Deflate.cpp LibCompress: Fix off-by-one error in generate_huffman_lengths 2023-12-04 00:06:38 +01:00
Deflate.h LibCompress: Fix a typo in m_read_final_block 2023-10-09 23:40:10 +02:00
DeflateTables.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Gzip.cpp LibCore: Make MappedFile OwnPtr-based 2023-09-27 03:22:56 +02:00
Gzip.h LibCompress: Let GzipDecompressor take a MaybeOwned<Stream> 2023-08-23 12:03:37 +01:00
Lzma.cpp Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Lzma.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Lzma2.cpp LibCompress: Avoid overflowing the size of uncompressed LZMA2 chunks 2023-03-30 14:39:31 +02:00
Lzma2.h LibCompress: Add support for LZMA2 2023-03-21 10:25:13 +01:00
LZWDecoder.h LibCompress: Add LZWDecoder::decode_all() 2023-12-01 12:58:14 +01:00
Xz.cpp LibCompress: Implement correct validation of last filters 2023-10-29 22:00:59 +01:00
Xz.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Zlib.cpp LibCompress: Port ZlibDecompressor to AK::Stream 2023-08-23 12:03:37 +01:00
Zlib.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00