aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma2_decoder.c
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-13 22:24:07 +0300
commit9595a3119b9faf0ce01375329cad8bbf85c35ea2 (patch)
treeac7d22c82eae07defb892a8230ffa67fb2c44f27 /src/liblzma/lzma/lzma2_decoder.c
parentxz: Document the special memlimit case of 2000 MiB on MIPS32. (diff)
downloadxz-9595a3119b9faf0ce01375329cad8bbf85c35ea2.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/lzma/lzma2_decoder.c')
-rw-r--r--src/liblzma/lzma/lzma2_decoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/lzma/lzma2_decoder.c b/src/liblzma/lzma/lzma2_decoder.c
index cf1b5110..105a28dc 100644
--- a/src/liblzma/lzma/lzma2_decoder.c
+++ b/src/liblzma/lzma/lzma2_decoder.c
@@ -139,7 +139,7 @@ lzma2_decode(void *coder_ptr, lzma_dict *restrict dict,
coder->uncompressed_size += in[(*in_pos)++] + 1U;
coder->sequence = SEQ_COMPRESSED_0;
coder->lzma.set_uncompressed(coder->lzma.coder,
- coder->uncompressed_size);
+ coder->uncompressed_size, false);
break;
case SEQ_COMPRESSED_0: