summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCompress
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-05-03 09:46:00 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-17 09:08:53 +0200
commit9ab3646bc7d16aafdb8a4d7ec89722a510cd13cd (patch)
tree2f1a5e55aea284245dc82b5367be00d566d2cee9 /Userland/Libraries/LibCompress
parent42514c69611b983ee5b4ac0552a032673907339a (diff)
downloadserenity-9ab3646bc7d16aafdb8a4d7ec89722a510cd13cd.zip
LibCompress: Use the variable for LZMA "normalized to real distance"
The variable already existed, but I forgot to use it earlier.
Diffstat (limited to 'Userland/Libraries/LibCompress')
-rw-r--r--Userland/Libraries/LibCompress/Lzma.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCompress/Lzma.cpp b/Userland/Libraries/LibCompress/Lzma.cpp
index 195853fe09..a565da2258 100644
--- a/Userland/Libraries/LibCompress/Lzma.cpp
+++ b/Userland/Libraries/LibCompress/Lzma.cpp
@@ -466,8 +466,8 @@ u32 LzmaState::current_repetition_offset() const
// Instead, the values are remapped so that the rep-value n starts reading n + 1 bytes back.
// The special rep-value 0xFFFFFFFF is reserved for marking the end of the stream,
// so this should never overflow.
- VERIFY(m_rep0 < NumericLimits<u32>::max());
- return m_rep0 + 1;
+ VERIFY(m_rep0 <= NumericLimits<u32>::max() - normalized_to_real_match_distance_offset);
+ return m_rep0 + normalized_to_real_match_distance_offset;
}
void LzmaState::update_state_after_literal()