]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Abort if Unsupported Parameters Used
authorW. Felix Handte <w@felixhandte.com>
Mon, 24 Apr 2023 15:50:01 +0000 (11:50 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 4 May 2023 16:18:58 +0000 (12:18 -0400)
lib/compress/zstd_compress.c
lib/compress/zstd_ldm.c

index 541b776f1d186ff243cfa360a0c2769c7197695a..09f0482394b600ea066014e8c39f8ee9f4ebf92e 100644 (file)
@@ -4820,6 +4820,8 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
     case ZSTD_dfast:
 #ifndef ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
         ZSTD_fillDoubleHashTable(ms, iend, dtlm, tfp);
+#else
+        assert(0); /* shouldn't be called: cparams should've been adjusted. */
 #endif
         break;
 
@@ -4845,6 +4847,8 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
                 DEBUGLOG(4, "Using chain-based hash table for lazy dict");
             }
         }
+#else
+        assert(0); /* shouldn't be called: cparams should've been adjusted. */
 #endif
         break;
 
@@ -4857,6 +4861,8 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
  || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR)
         assert(srcSize >= HASH_READ_SIZE);
         ZSTD_updateTree(ms, iend-HASH_READ_SIZE, iend);
+#else
+        assert(0); /* shouldn't be called: cparams should've been adjusted. */
 #endif
         break;
 
index 8581e2356fbaff358260db98220116e071ffb7a1..eda45816e9938416019d5456eb20abe78d02cfe9 100644 (file)
@@ -248,6 +248,8 @@ static size_t ZSTD_ldm_fillFastTables(ZSTD_matchState_t* ms,
     case ZSTD_dfast:
 #ifndef ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
         ZSTD_fillDoubleHashTable(ms, iend, ZSTD_dtlm_fast, ZSTD_tfp_forCCtx);
+#else
+        assert(0); /* shouldn't be called: cparams should've been adjusted. */
 #endif
         break;