liblzma: Improve lzma encoder init function consistency.

lzma_encoder_init() did not check for NULL options, but
lzma2_encoder_init() did. This is more of a code style improvement than
anything else to help make lzma_encoder_init() and lzma2_encoder_init()
more similar.
This commit is contained in:
Jia Tan 2023-12-16 20:18:47 +08:00
parent 6af9a4cbe5
commit 019afd72e0
1 changed files with 3 additions and 0 deletions

View File

@ -712,6 +712,9 @@ static lzma_ret
lzma_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator, lzma_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator,
lzma_vli id, const void *options, lzma_lz_options *lz_options) lzma_vli id, const void *options, lzma_lz_options *lz_options)
{ {
if (options == NULL)
return LZMA_PROG_ERROR;
lz->code = &lzma_encode; lz->code = &lzma_encode;
lz->set_out_limit = &lzma_lzma_set_out_limit; lz->set_out_limit = &lzma_lzma_set_out_limit;
return lzma_lzma_encoder_create( return lzma_lzma_encoder_create(