From 05574ec1410205e5634e5ad587ed9fcb5a4479e2 Mon Sep 17 00:00:00 2001 From: Bimba Shrestha Date: Fri, 3 Apr 2020 12:40:31 -0700 Subject: [PATCH] adding oversizeDuration to dctx and macros --- lib/decompress/zstd_decompress.c | 1 + lib/decompress/zstd_decompress_internal.h | 5 +++++ 2 files changed, 6 insertions(+) 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" */