]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Also Attach Dict When Source Size is Unknown
authorW. Felix Handte <w@felixhandte.com>
Tue, 15 May 2018 17:13:19 +0000 (13:13 -0400)
committerW. Felix Handte <w@felixhandte.com>
Wed, 23 May 2018 21:53:03 +0000 (17:53 -0400)
lib/compress/zstd_compress.c

index 9f488b9ac12cdcf7bad8e8abccb89b63b14086dc..4d4e171bcc019b4b398f7e32bc437595c65c94fa 100644 (file)
@@ -1208,7 +1208,8 @@ static size_t ZSTD_resetCCtx_usingCDict(ZSTD_CCtx* cctx,
      * context, or referencing the dictionary context from the working context
      * in-place. We decide here which strategy to use. */
     /* TODO: pick reasonable cut-off size, handle ZSTD_CONTENTSIZE_UNKNOWN */
-    int attachDict = pledgedSrcSize <= 8 KB
+    int attachDict = ( pledgedSrcSize <= 8 KB
+                    || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN )
                   && cdict->cParams.strategy == ZSTD_fast
                   && ZSTD_equivalentCParams(cctx->appliedParams.cParams,
                                             cdict->cParams);