]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[cover] Add dictionary size to compressed size
authorNick Terrell <terrelln@fb.com>
Mon, 21 Aug 2017 21:23:17 +0000 (14:23 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 21 Aug 2017 21:23:17 +0000 (14:23 -0700)
lib/dictBuilder/cover.c

index 07fedc2d157f693c30f63a8e1c0f64bb9d7fc51a..3770c2cac4471631961803f9d95f1267c67edde6 100644 (file)
@@ -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],