]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
ZSTDMT_endStream : nullify input buffer after flush
authorYann Collet <cyan@fb.com>
Wed, 18 Jan 2017 23:32:38 +0000 (15:32 -0800)
committerYann Collet <cyan@fb.com>
Wed, 18 Jan 2017 23:32:38 +0000 (15:32 -0800)
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

index c417e8aadb688935ed1f69dea79a10d3800e25e0..d552acee0199fec020f3045f4b69316a73c77fb1 100644 (file)
@@ -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;
         }