]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
adding oversizeDuration to dctx and macros
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 19:40:31 +0000 (12:40 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 20:08:29 +0000 (13:08 -0700)
lib/decompress/zstd_decompress.c
lib/decompress/zstd_decompress_internal.h

index 1770476a6d8ad2d1a6e0e29c16fdfa0cf9877964..3c51db43907304e52aa63708b63def6e44c85804 100644 (file)
@@ -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());
 }
 
index 059c81940329c599dc8a41c8482fa579ae89b94c..68c31381130f55c2cacc0982e30edd6338a2caf7 100644 (file)
@@ -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" */