LibCompress: Decrease CanonicalCode's size on stack

This commit stores the bit codes as u16s instead of u32s as the
maximum code bit length in DEFLATE is 15.
This commit is contained in:
Idan Horowitz 2021-03-14 14:19:47 +02:00 committed by Andreas Kling
parent ab9f66a069
commit 02b4cb96f8
Notes: sideshowbarker 2024-07-18 21:22:13 +09:00

View file

@ -49,12 +49,12 @@ public:
private:
// Decompression - indexed by code
Vector<u32> m_symbol_codes;
Vector<u32> m_symbol_values;
Vector<u16> m_symbol_codes;
Vector<u16> m_symbol_values;
// Compression - indexed by symbol
Array<u32, 288> m_bit_codes {}; // deflate uses a maximum of 288 symbols (maximum of 32 for distances)
Array<u32, 288> m_bit_code_lengths {};
Array<u16, 288> m_bit_codes {}; // deflate uses a maximum of 288 symbols (maximum of 32 for distances)
Array<u16, 288> m_bit_code_lengths {};
};
class DeflateDecompressor final : public InputStream {