aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-07-13 22:24:07 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-07-24 11:36:56 +0300
commitff54b557fe3b06b59a24e4028c1464c35dd5b142 (patch)
tree47c227ef6dd8b42204ee119326efbc34a9b518d1 /src/liblzma/common
parentTests: Add test file good-1-empty-bcj-lzma2.xz. (diff)
downloadxz-ff54b557fe3b06b59a24e4028c1464c35dd5b142.tar.xz
liblzma: Add optional autodetection of LZMA end marker.
Turns out that this is needed for .lzma files as the spec in LZMA SDK says that end marker may be present even if the size is stored in the header. Such files are rare but exist in the real world. The code in liblzma is so old that the spec didn't exist in LZMA SDK back then and I had understood that such files weren't possible (the lzma tool in LZMA SDK didn't create such files). This modifies the internal API so that LZMA decoder can be told if EOPM is allowed even when the uncompressed size is known. It's allowed with .lzma and not with other uses. Thanks to Karl Beldan for reporting the problem.
Diffstat (limited to 'src/liblzma/common')
-rw-r--r--src/liblzma/common/alone_decoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/common/alone_decoder.c b/src/liblzma/common/alone_decoder.c
index 239b230e..a3ea20a2 100644
--- a/src/liblzma/common/alone_decoder.c
+++ b/src/liblzma/common/alone_decoder.c
@@ -146,7 +146,7 @@ alone_decode(void *coder_ptr, const lzma_allocator *allocator,
// Use a hack to set the uncompressed size.
lzma_lz_decoder_uncompressed(coder->next.coder,
- coder->uncompressed_size);
+ coder->uncompressed_size, true);
coder->sequence = SEQ_CODE;
break;