From 6073b3e6b86488d1d6963b7dbf3fedf34ac7158e Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 18 Jan 2017 15:32:38 -0800 Subject: [PATCH] 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). --- lib/compress/zstdmt_compress.c | 2 ++ 1 file changed, 2 insertions(+) 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; }