mirror of
https://github.com/RGBCube/serenity
synced 2025-07-22 21:57:35 +00:00
Deflate: Fix deadly typo.
This commit is contained in:
parent
b9a6c07bb7
commit
e2e2e782d4
2 changed files with 2 additions and 2 deletions
|
@ -110,6 +110,7 @@ u32 DeflateDecompressor::CanonicalCode::read_symbol(InputBitStream& stream) cons
|
||||||
for (;;) {
|
for (;;) {
|
||||||
code_bits = code_bits << 1 | stream.read_bits(1);
|
code_bits = code_bits << 1 | stream.read_bits(1);
|
||||||
|
|
||||||
|
// FIXME: This seems really inefficent, this could be an index into an array instead.
|
||||||
size_t index;
|
size_t index;
|
||||||
if (AK::binary_search(m_symbol_codes.span(), code_bits, AK::integral_compare<u32>, &index))
|
if (AK::binary_search(m_symbol_codes.span(), code_bits, AK::integral_compare<u32>, &index))
|
||||||
return m_symbol_values[index];
|
return m_symbol_values[index];
|
||||||
|
@ -405,7 +406,7 @@ void DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Optional<Can
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto nrepeat = 3 + m_input_stream.read_bits(3);
|
auto nrepeat = 3 + m_input_stream.read_bits(2);
|
||||||
for (size_t j = 0; j < nrepeat; ++j)
|
for (size_t j = 0; j < nrepeat; ++j)
|
||||||
code_lengths.append(code_lengths.last());
|
code_lengths.append(code_lengths.last());
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,6 @@ size_t GzipDecompressor::read(Bytes bytes)
|
||||||
if (m_input_stream.eof())
|
if (m_input_stream.eof())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// FIXME: This fails with the new changes?
|
|
||||||
BlockHeader header;
|
BlockHeader header;
|
||||||
m_input_stream >> Bytes { &header, sizeof(header) };
|
m_input_stream >> Bytes { &header, sizeof(header) };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue