diff options
Diffstat (limited to 'Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c')
-rw-r--r-- | Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c b/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c index ff27a11..b4bd388 100644 --- a/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c +++ b/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c @@ -18,6 +18,9 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) { + lzma_next_coder block_decoder; + lzma_ret ret; + if (in_pos == NULL || (in == NULL && *in_pos != in_size) || *in_pos > in_size || out_pos == NULL || (out == NULL && *out_pos != out_size) @@ -25,9 +28,8 @@ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator, return LZMA_PROG_ERROR; // Initialize the Block decoder. - lzma_next_coder block_decoder = LZMA_NEXT_CODER_INIT; - lzma_ret ret = lzma_block_decoder_init( - &block_decoder, allocator, block); + block_decoder = LZMA_NEXT_CODER_INIT; + ret = lzma_block_decoder_init(&block_decoder, allocator, block); if (ret == LZMA_OK) { // Save the positions so that we can restore them in case |