aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-12-16 20:18:47 +0800
committerJia Tan <jiat0218@gmail.com>2023-12-22 20:02:06 +0800
commit019afd72e02339a6bf00c32bfb56f649c637dd6b (patch)
tree2d7bbe2192b8c426b753cc8243b1cae449edf91a /src/liblzma
parentDocs: Update repository URL in Changelog. (diff)
downloadxz-019afd72e02339a6bf00c32bfb56f649c637dd6b.tar.xz
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.
Diffstat (limited to 'src/liblzma')
-rw-r--r--src/liblzma/lzma/lzma_encoder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c
index 559c63ed..79fdeca2 100644
--- a/src/liblzma/lzma/lzma_encoder.c
+++ b/src/liblzma/lzma/lzma_encoder.c
@@ -712,6 +712,9 @@ static lzma_ret
lzma_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator,
lzma_vli id, const void *options, lzma_lz_options *lz_options)
{
+ if (options == NULL)
+ return LZMA_PROG_ERROR;
+
lz->code = &lzma_encode;
lz->set_out_limit = &lzma_lzma_set_out_limit;
return lzma_lzma_encoder_create(