diff --git a/lib/dictBuilder/cover.c b/lib/dictBuilder/cover.c index 07fedc2d..3770c2ca 100644 --- a/lib/dictBuilder/cover.c +++ b/lib/dictBuilder/cover.c @@ -888,7 +888,7 @@ static void COVER_tryParameters(void *opaque) { goto _compressCleanup; } /* Compress each sample and sum their sizes (or error) */ - totalCompressedSize = 0; + totalCompressedSize = dictBufferCapacity; for (i = 0; i < ctx->nbSamples; ++i) { const size_t size = ZSTD_compress_usingCDict( cctx, dst, dstCapacity, ctx->samples + ctx->offsets[i],