From: Yann Collet Date: Wed, 18 Jan 2017 23:32:38 +0000 (-0800) Subject: ZSTDMT_endStream : nullify input buffer after flush X-Git-Tag: v1.1.3^2~19^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6073b3e6b86488d1d6963b7dbf3fedf34ac7158e;p=thirdparty%2Fzstd.git ZSTDMT_endStream : nullify input buffer after flush There will be no more input after ZSTDMT_endStream invocation : only flush/end is allowed (to fully collect compressed result). --- diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index c417e8aad..d552acee0 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -543,6 +543,8 @@ static size_t ZSTDMT_flushStream_internal(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* outp return ERROR(memory_allocation); } } else { + zcs->inBuff.buffer = g_nullBuffer; + zcs->inBuff.filled = 0; zcs->frameEnded = 1; }