aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-02-01 22:40:35 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-02-01 22:40:35 +0200
commit8dd7b6052e18621e2e6c62f40f762ee88bd3eb65 (patch)
tree8dd753e7d00e3a4d5b31524efa65e0c63c790568
parentAdded initial version of raw buffer-to-buffer coding (diff)
downloadxz-8dd7b6052e18621e2e6c62f40f762ee88bd3eb65.tar.xz
Fix a bug in lzma_block_buffer_decode(), although this
function should be rewritten anyway.
-rw-r--r--src/liblzma/common/block_buffer_decoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liblzma/common/block_buffer_decoder.c b/src/liblzma/common/block_buffer_decoder.c
index ec24e44b..9f95637c 100644
--- a/src/liblzma/common/block_buffer_decoder.c
+++ b/src/liblzma/common/block_buffer_decoder.c
@@ -50,10 +50,6 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
if (ret == LZMA_STREAM_END) {
ret = LZMA_OK;
} else {
- // Something went wrong, restore the positions.
- *in_pos = in_start;
- *out_pos = out_start;
-
if (ret == LZMA_OK) {
// Either the input was truncated or the
// output buffer was too small.
@@ -75,6 +71,10 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
else
ret = LZMA_BUF_ERROR;
}
+
+ // Restore the positions.
+ *in_pos = in_start;
+ *out_pos = out_start;
}
}