aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-12-16 20:18:47 +0800
committerJia Tan <jiat0218@gmail.com>2023-12-16 20:18:47 +0800
commit5dad6f628af742bab826819760deb677597445f7 (patch)
tree34ad5af97a0fe3d58cc7429542b785aa7842b0fe /src
parentDocs: Update repository URL in Changelog. (diff)
downloadxz-5dad6f628af742bab826819760deb677597445f7.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 '')
-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(