From: Bimba Shrestha Date: Fri, 3 Apr 2020 19:40:31 +0000 (-0700) Subject: adding oversizeDuration to dctx and macros X-Git-Tag: v1.4.5^2~67^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05574ec1410205e5634e5ad587ed9fcb5a4479e2;p=thirdparty%2Fzstd.git adding oversizeDuration to dctx and macros --- diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 1770476a6..3c51db439 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -111,6 +111,7 @@ static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx) dctx->legacyContext = NULL; dctx->previousLegacyVersion = 0; dctx->noForwardProgress = 0; + dctx->oversizedDuration = 0; dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid()); } diff --git a/lib/decompress/zstd_decompress_internal.h b/lib/decompress/zstd_decompress_internal.h index 059c81940..68c313811 100644 --- a/lib/decompress/zstd_decompress_internal.h +++ b/lib/decompress/zstd_decompress_internal.h @@ -95,6 +95,9 @@ typedef enum { ZSTD_use_once = 1 /* Use the dictionary once and set to ZSTD_dont_use */ } ZSTD_dictUses_e; +#define ZSTD_OVERSIZED_MAXDURATION 128 +#define ZSTD_OVERSIZED_FACTOR 3 + struct ZSTD_DCtx_s { const ZSTD_seqSymbol* LLTptr; @@ -151,6 +154,8 @@ struct ZSTD_DCtx_s /* workspace */ BYTE litBuffer[ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH]; BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX]; + + size_t oversizedDuration; }; /* typedef'd to ZSTD_DCtx within "zstd.h" */