diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-17 13:14:20 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-17 13:14:20 +0200 |
commit | f88590e0014b38d40465937c19f25f05f16c79ae (patch) | |
tree | 7a0904b999dc7bf401efd8fa0045da22a0af7dd8 /src | |
parent | Tiny non-technical edits to file-format.txt. (diff) | |
download | xz-f88590e0014b38d40465937c19f25f05f16c79ae.tar.xz |
Fix Subblock docoder: If Subblock filter was used with known
Uncompressed Size, and the last output byte was from RLE,
the code didn't stop decoding as it should have done.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/subblock/subblock_decoder.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/liblzma/subblock/subblock_decoder.c b/src/liblzma/subblock/subblock_decoder.c index 5895242e..4eb9e55f 100644 --- a/src/liblzma/subblock/subblock_decoder.c +++ b/src/liblzma/subblock/subblock_decoder.c @@ -363,6 +363,7 @@ decode_buffer(lzma_coder *coder, lzma_allocator *allocator, return LZMA_DATA_ERROR; if (coder->repeat.count == 0) { + assert(coder->subfilter.code == NULL); if (coder->uncompressed_size == 0) return LZMA_STREAM_END; } else { @@ -424,6 +425,11 @@ decode_buffer(lzma_coder *coder, lzma_allocator *allocator, } } while (*out_pos < out_size); + // Check if we have decoded all the data. + if (coder->uncompressed_size == 0 + && coder->subfilter.code == NULL) + return LZMA_STREAM_END; + break; case SEQ_DATA: { |