]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Clarify a comment.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 12 Feb 2024 15:09:10 +0000 (17:09 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 14 Feb 2024 16:31:16 +0000 (18:31 +0200)
src/liblzma/lzma/lzma_decoder.c

index f7323061315086147fcf3d9723f621b8eecdfe0c..6c9cbe22d0fc54eb7f6162c088240b3a21c2b145 100644 (file)
@@ -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.