aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-01-25 01:35:56 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-01-25 01:35:56 +0200
commit2c5fe958e4bbe9b147b10c255955dfe2827fb8e7 (patch)
tree83c8cd45c94e5b5da18c10ad4e2cd3f78797aa89 /src/liblzma/common
parentAdded lzma_stream_buffer_decode() and made minor cleanups. (diff)
downloadxz-2c5fe958e4bbe9b147b10c255955dfe2827fb8e7.tar.xz
Fix a dumb bug in Block decoder, which made it return
LZMA_DATA_ERROR with valid data. The bug was added in e114502b2bc371e4a45449832cb69be036360722.
Diffstat (limited to 'src/liblzma/common')
-rw-r--r--src/liblzma/common/block_decoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liblzma/common/block_decoder.c b/src/liblzma/common/block_decoder.c
index b130f567..59a20bfa 100644
--- a/src/liblzma/common/block_decoder.c
+++ b/src/liblzma/common/block_decoder.c
@@ -131,15 +131,15 @@ block_decode(lzma_coder *coder, lzma_allocator *allocator,
case SEQ_PADDING:
// Compressed Data is padded to a multiple of four bytes.
while (coder->compressed_size & 3) {
+ if (*in_pos >= in_size)
+ return LZMA_OK;
+
// We use compressed_size here just get the Padding
// right. The actual Compressed Size was stored to
// coder->block already, and won't be modified by
// us anymore.
++coder->compressed_size;
- if (*in_pos >= in_size)
- return LZMA_OK;
-
if (in[(*in_pos)++] != 0x00)
return LZMA_DATA_ERROR;
}