From: W. Felix Handte Date: Wed, 12 Sep 2018 19:29:53 +0000 (-0700) Subject: When Attaching Dictionary, Size Working Tables Based on Input Size Only X-Git-Tag: v1.3.6^2~10^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c38acff94f296114f84464387f94f51b21b22d3a;p=thirdparty%2Fzstd.git When Attaching Dictionary, Size Working Tables Based on Input Size Only --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index da8bd1e1e..2bd672c15 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1344,8 +1344,9 @@ static size_t ZSTD_resetCCtx_byAttachingCDict( const ZSTD_compressionParameters *cdict_cParams = &cdict->matchState.cParams; unsigned const windowLog = params.cParams.windowLog; assert(windowLog != 0); - /* Copy only compression parameters related to tables. */ - params.cParams = *cdict_cParams; + /* Resize working context table params for input only, since the dict + * has its own tables. */ + params.cParams = ZSTD_adjustCParams_internal(*cdict_cParams, pledgedSrcSize, 0); params.cParams.windowLog = windowLog; ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, ZSTDcrp_continue, zbuff);