aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-05 01:20:24 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-05 01:20:24 +0200
commitd160ee32598c6d1cd9054ef019e8c9331208b188 (patch)
tree47c9d0b41245129628ff8eb9d6a6444ebebbc5d2 /src
parentFix stupid bugs in flush marker detection. (diff)
downloadxz-d160ee32598c6d1cd9054ef019e8c9331208b188.tar.xz
Another bug fix for flush marker detection.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/lzma/lzma_decoder.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c
index 90531c8d..fd57ac82 100644
--- a/src/liblzma/lzma/lzma_decoder.c
+++ b/src/liblzma/lzma/lzma_decoder.c
@@ -493,9 +493,17 @@ decode_real(lzma_coder *restrict coder, const uint8_t *restrict in,
has_produced_output = false;
+ // We know that we have enough input to call
+ // this macro, because it is tested at the
+ // end of decode_dummy().
+ rc_normalize();
+
rc_reset(rc);
+
+ // If we don't have enough input here, we jump
+ // out of the loop without calling rc_normalize().
if (!rc_read_init(&rc, in, &in_pos_local, in_size))
- goto out; // Avoiding rc_normalize()
+ goto out;
} else {
return true;