From 3619c34399acc8f68eadd6a2d88b7c47b2f6deca Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 10 Dec 2018 17:42:35 -0800 Subject: [PATCH] fix assert position within ZSTD_compress2() --- lib/compress/zstd_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 3d6ed47e..f05b5e10 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -4068,11 +4068,11 @@ size_t ZSTD_compress2(ZSTD_CCtx* cctx, src, srcSize, &iPos, ZSTD_e_end); if (ZSTD_isError(result)) return result; - assert(iPos == srcSize); if (result != 0) { /* compression not completed, due to lack of output space */ assert(oPos == dstCapacity); return ERROR(dstSize_tooSmall); } + assert(iPos == srcSize); /* all input is expected consumed */ return oPos; } }