summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-09-04 14:30:53 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-06 12:54:45 +0200
commite2e2e782d4136b20aec4d5a67e938db2bc414e04 (patch)
tree05e058f8d7703aa042ebe6ea0e87a73cc296b207
parentb9a6c07bb7912a29debfe0a3ee99e6b813828507 (diff)
downloadserenity-e2e2e782d4136b20aec4d5a67e938db2bc414e04.zip
Deflate: Fix deadly typo.
-rw-r--r--Libraries/LibCompress/Deflate.cpp3
-rw-r--r--Libraries/LibCompress/Gzip.cpp1
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibCompress/Deflate.cpp b/Libraries/LibCompress/Deflate.cpp
index 458096953e..ca04508be3 100644
--- a/Libraries/LibCompress/Deflate.cpp
+++ b/Libraries/LibCompress/Deflate.cpp
@@ -110,6 +110,7 @@ u32 DeflateDecompressor::CanonicalCode::read_symbol(InputBitStream& stream) cons
for (;;) {
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;
if (AK::binary_search(m_symbol_codes.span(), code_bits, AK::integral_compare<u32>, &index))
return m_symbol_values[index];
@@ -405,7 +406,7 @@ void DeflateDecompressor::decode_codes(CanonicalCode& literal_code, Optional<Can
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)
code_lengths.append(code_lengths.last());
}
diff --git a/Libraries/LibCompress/Gzip.cpp b/Libraries/LibCompress/Gzip.cpp
index 6f3b40bfba..956b4f011c 100644
--- a/Libraries/LibCompress/Gzip.cpp
+++ b/Libraries/LibCompress/Gzip.cpp
@@ -97,7 +97,6 @@ size_t GzipDecompressor::read(Bytes bytes)
if (m_input_stream.eof())
return 0;
- // FIXME: This fails with the new changes?
BlockHeader header;
m_input_stream >> Bytes { &header, sizeof(header) };