aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_decoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2024-02-12 17:09:10 +0200
committerLasse Collin <lasse.collin@tukaani.org>2024-02-14 18:31:16 +0200
commite290a72d6dee71faf3a90c9678b2f730083666a7 (patch)
tree61d63bfd0484b18fe9e2846e1e9859fbe6c56083 /src/liblzma/lzma/lzma_decoder.c
parentliblzma: LZMA decoder: Optimize loop comparison. (diff)
downloadxz-e290a72d6dee71faf3a90c9678b2f730083666a7.tar.xz
liblzma: Clarify a comment.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_decoder.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c
index f7323061..6c9cbe22 100644
--- a/src/liblzma/lzma/lzma_decoder.c
+++ b/src/liblzma/lzma/lzma_decoder.c
@@ -338,9 +338,12 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// Non-resumable Mode (fast) //
///////////////////////////////
- // If there is not enough room for another LZMA symbol
- // go to Resumable mode.
- if (unlikely(!rc_is_fast_allowed() || dict.pos == dict.limit))
+ // Go to Resumable mode (1) if there is not enough input to
+ // safely decode any possible LZMA symbol or (2) if the
+ // dictionary is full, which may need special checks that
+ // are only done in the Resumable mode.
+ if (unlikely(!rc_is_fast_allowed()
+ || dict.pos == dict.limit))
goto slow;
// Decode the first bit from the next LZMA symbol.