mirror of https://git.tukaani.org/xz.git
Fix a bug in lzma_block_buffer_decode(), although this
function should be rewritten anyway.
This commit is contained in:
parent
55fd41431e
commit
8dd7b6052e
|
@ -50,10 +50,6 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
|
||||||
if (ret == LZMA_STREAM_END) {
|
if (ret == LZMA_STREAM_END) {
|
||||||
ret = LZMA_OK;
|
ret = LZMA_OK;
|
||||||
} else {
|
} else {
|
||||||
// Something went wrong, restore the positions.
|
|
||||||
*in_pos = in_start;
|
|
||||||
*out_pos = out_start;
|
|
||||||
|
|
||||||
if (ret == LZMA_OK) {
|
if (ret == LZMA_OK) {
|
||||||
// Either the input was truncated or the
|
// Either the input was truncated or the
|
||||||
// output buffer was too small.
|
// output buffer was too small.
|
||||||
|
@ -75,6 +71,10 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
|
||||||
else
|
else
|
||||||
ret = LZMA_BUF_ERROR;
|
ret = LZMA_BUF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore the positions.
|
||||||
|
*in_pos = in_start;
|
||||||
|
*out_pos = out_start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue