diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2017-03-30 19:16:55 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2017-03-30 19:16:55 +0300 |
commit | 84462afaada61379f5878e46f8f00e25a1cdcf29 (patch) | |
tree | ff1811c01a2bcfadfcb23c0df55a0a31ff36367d /src/liblzma/common/stream_decoder.c | |
parent | liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). (diff) | |
download | xz-84462afaada61379f5878e46f8f00e25a1cdcf29.tar.xz |
liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/common/stream_decoder.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c index 7ae7a670..fdd8ff2f 100644 --- a/src/liblzma/common/stream_decoder.c +++ b/src/liblzma/common/stream_decoder.c @@ -422,9 +422,6 @@ lzma_stream_decoder_init( { lzma_next_coder_init(&lzma_stream_decoder_init, next, allocator); - if (memlimit == 0) - return LZMA_PROG_ERROR; - if (flags & ~LZMA_SUPPORTED_FLAGS) return LZMA_OPTIONS_ERROR; @@ -444,7 +441,7 @@ lzma_stream_decoder_init( coder->index_hash = NULL; } - coder->memlimit = memlimit; + coder->memlimit = my_max(1, memlimit); coder->memusage = LZMA_MEMUSAGE_BASE; coder->tell_no_check = (flags & LZMA_TELL_NO_CHECK) != 0; coder->tell_unsupported_check |