lzma_decoder.c | lzma_decoder.c | |||
---|---|---|---|---|
skipping to change at line 933 | skipping to change at line 933 | |||
coder->probs = NULL; | coder->probs = NULL; | |||
coder->symbol = 0; | coder->symbol = 0; | |||
coder->limit = 0; | coder->limit = 0; | |||
coder->offset = 0; | coder->offset = 0; | |||
coder->len = 0; | coder->len = 0; | |||
return; | return; | |||
} | } | |||
extern lzma_ret | extern lzma_ret | |||
lzma_lzma_decoder_create(lzma_lz_decoder *lz, lzma_allocator *allocator, | lzma_lzma_decoder_create(lzma_lz_decoder *lz, const lzma_allocator *allocat or, | |||
const void *opt, lzma_lz_options *lz_options) | const void *opt, lzma_lz_options *lz_options) | |||
{ | { | |||
if (lz->coder == NULL) { | if (lz->coder == NULL) { | |||
lz->coder = lzma_alloc(sizeof(lzma_coder), allocator); | lz->coder = lzma_alloc(sizeof(lzma_coder), allocator); | |||
if (lz->coder == NULL) | if (lz->coder == NULL) | |||
return LZMA_MEM_ERROR; | return LZMA_MEM_ERROR; | |||
lz->code = &lzma_decode; | lz->code = &lzma_decode; | |||
lz->reset = &lzma_decoder_reset; | lz->reset = &lzma_decoder_reset; | |||
lz->set_uncompressed = &lzma_decoder_uncompressed; | lz->set_uncompressed = &lzma_decoder_uncompressed; | |||
skipping to change at line 960 | skipping to change at line 960 | |||
lz_options->preset_dict = options->preset_dict; | lz_options->preset_dict = options->preset_dict; | |||
lz_options->preset_dict_size = options->preset_dict_size; | lz_options->preset_dict_size = options->preset_dict_size; | |||
return LZMA_OK; | return LZMA_OK; | |||
} | } | |||
/// Allocate and initialize LZMA decoder. This is used only via LZ | /// Allocate and initialize LZMA decoder. This is used only via LZ | |||
/// initialization (lzma_lzma_decoder_init() passes function pointer to | /// initialization (lzma_lzma_decoder_init() passes function pointer to | |||
/// the LZ initialization). | /// the LZ initialization). | |||
static lzma_ret | static lzma_ret | |||
lzma_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator, | lzma_decoder_init(lzma_lz_decoder *lz, const lzma_allocator *allocator, | |||
const void *options, lzma_lz_options *lz_options) | const void *options, lzma_lz_options *lz_options) | |||
{ | { | |||
if (!is_lclppb_valid(options)) | if (!is_lclppb_valid(options)) | |||
return LZMA_PROG_ERROR; | return LZMA_PROG_ERROR; | |||
return_if_error(lzma_lzma_decoder_create( | return_if_error(lzma_lzma_decoder_create( | |||
lz, allocator, options, lz_options)); | lz, allocator, options, lz_options)); | |||
lzma_decoder_reset(lz->coder, options); | lzma_decoder_reset(lz->coder, options); | |||
lzma_decoder_uncompressed(lz->coder, LZMA_VLI_UNKNOWN); | lzma_decoder_uncompressed(lz->coder, LZMA_VLI_UNKNOWN); | |||
return LZMA_OK; | return LZMA_OK; | |||
} | } | |||
extern lzma_ret | extern lzma_ret | |||
lzma_lzma_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, | lzma_lzma_decoder_init(lzma_next_coder *next, const lzma_allocator *allocat or, | |||
const lzma_filter_info *filters) | const lzma_filter_info *filters) | |||
{ | { | |||
// LZMA can only be the last filter in the chain. This is enforced | // LZMA can only be the last filter in the chain. This is enforced | |||
// by the raw_decoder initialization. | // by the raw_decoder initialization. | |||
assert(filters[1].init == NULL); | assert(filters[1].init == NULL); | |||
return lzma_lz_decoder_init(next, allocator, filters, | return lzma_lz_decoder_init(next, allocator, filters, | |||
&lzma_decoder_init); | &lzma_decoder_init); | |||
} | } | |||
skipping to change at line 1019 | skipping to change at line 1019 | |||
extern uint64_t | extern uint64_t | |||
lzma_lzma_decoder_memusage(const void *options) | lzma_lzma_decoder_memusage(const void *options) | |||
{ | { | |||
if (!is_lclppb_valid(options)) | if (!is_lclppb_valid(options)) | |||
return UINT64_MAX; | return UINT64_MAX; | |||
return lzma_lzma_decoder_memusage_nocheck(options); | return lzma_lzma_decoder_memusage_nocheck(options); | |||
} | } | |||
extern lzma_ret | extern lzma_ret | |||
lzma_lzma_props_decode(void **options, lzma_allocator *allocator, | lzma_lzma_props_decode(void **options, const lzma_allocator *allocator, | |||
const uint8_t *props, size_t props_size) | const uint8_t *props, size_t props_size) | |||
{ | { | |||
if (props_size != 5) | if (props_size != 5) | |||
return LZMA_OPTIONS_ERROR; | return LZMA_OPTIONS_ERROR; | |||
lzma_options_lzma *opt | lzma_options_lzma *opt | |||
= lzma_alloc(sizeof(lzma_options_lzma), allocator); | = lzma_alloc(sizeof(lzma_options_lzma), allocator); | |||
if (opt == NULL) | if (opt == NULL) | |||
return LZMA_MEM_ERROR; | return LZMA_MEM_ERROR; | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |