From ef36c6362f3f3853f21b8a6359bcd06576ebf207 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 30 Mar 2017 19:16:55 +0300 Subject: liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. --- src/liblzma/common/auto_decoder.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/liblzma/common/auto_decoder.c') diff --git a/src/liblzma/common/auto_decoder.c b/src/liblzma/common/auto_decoder.c index 09acd6dc..479b150f 100644 --- a/src/liblzma/common/auto_decoder.c +++ b/src/liblzma/common/auto_decoder.c @@ -155,9 +155,6 @@ auto_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, { lzma_next_coder_init(&auto_decoder_init, next, allocator); - if (memlimit == 0) - return LZMA_PROG_ERROR; - if (flags & ~LZMA_SUPPORTED_FLAGS) return LZMA_OPTIONS_ERROR; @@ -175,7 +172,7 @@ auto_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, coder->next = LZMA_NEXT_CODER_INIT; } - coder->memlimit = memlimit; + coder->memlimit = my_max(1, memlimit); coder->flags = flags; coder->sequence = SEQ_INIT; -- cgit v1.2.3