aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/microlzma_encoder.c
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2022-12-20 20:46:44 +0800
committerJia Tan <jiat0218@gmail.com>2022-12-20 22:23:59 +0800
commitd3e6fe44196bf9478ad193522e2b48febf2eca6b (patch)
treee4c9bd4f09886b08e9b880697b1160b4122dd66d /src/liblzma/common/microlzma_encoder.c
parentliblzma: Update authors list in arm64.c. (diff)
downloadxz-d3e6fe44196bf9478ad193522e2b48febf2eca6b.tar.xz
liblzma: Fix lzma_microlzma_encoder() return value.
Using return_if_error on lzma_lzma_lclppb_encode was improper because return_if_error is expecting an lzma_ret value, but lzma_lzma_lclppb_encode returns a boolean. This could result in lzma_microlzma_encoder, which would be misleading for applications.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/microlzma_encoder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liblzma/common/microlzma_encoder.c b/src/liblzma/common/microlzma_encoder.c
index d3ef0632..a787ca25 100644
--- a/src/liblzma/common/microlzma_encoder.c
+++ b/src/liblzma/common/microlzma_encoder.c
@@ -111,7 +111,8 @@ microlzma_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
// Encode the properties byte. Bitwise-negation of it will be the
// first output byte.
- return_if_error(lzma_lzma_lclppb_encode(options, &coder->props));
+ if (lzma_lzma_lclppb_encode(options, &coder->props))
+ return LZMA_OPTIONS_ERROR;
// Initialize the LZMA encoder.
const lzma_filter_info filters[2] = {