]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
add a check, to return an error if Sequence validation is enabled
authorYann Collet <cyan@fb.com>
Thu, 19 Dec 2024 23:39:57 +0000 (15:39 -0800)
committerYann Collet <cyan@fb.com>
Fri, 20 Dec 2024 18:37:01 +0000 (10:37 -0800)
since ZSTD_compressSequencesAndLiterals() doesn't support it.

doc/zstd_manual.html
lib/compress/zstd_compress.c
lib/zstd.h

index 30908e0aa677ad27e1c84d12740b720d4fd32618..dd6f9d7abe83e09a3fc64bc0ebde293448e360bd 100644 (file)
@@ -1430,7 +1430,8 @@ ZSTD_compressSequencesAndLiterals(ZSTD_CCtx* cctx,
  It's a speed optimization, useful when the right conditions are met,
  but it also features the following limitations:
  - Only supports explicit delimiter mode
- - Not compatible with frame checksum, which must disabled
+ - Currently does not support Sequences validation (so input Sequences are trusted)
+ - Not compatible with frame checksum, which must be disabled
  - If any block is incompressible, will fail and return an error
  - @litSize must be == sum of all @.litLength fields in @inSeqs. Any discrepancy will generate an error.
  - the buffer @literals must be larger than @litSize by at least 8 bytes.
index 5ef7337cc0036c82f2c0e506fae042c75e15d9a4..b5831650ff04a4c394d9c5a5259e506c3ed35ce1 100644 (file)
@@ -7319,6 +7319,9 @@ ZSTD_compressSequencesAndLiterals(ZSTD_CCtx* cctx,
     if (cctx->appliedParams.blockDelimiters == ZSTD_sf_noBlockDelimiters) {
         RETURN_ERROR(frameParameter_unsupported, "This mode is only compatible with explicit delimiters");
     }
+    if (cctx->appliedParams.validateSequences) {
+        RETURN_ERROR(parameter_unsupported, "This mode is not compatible with Sequence validation");
+    }
     if (cctx->appliedParams.fParams.checksumFlag) {
         RETURN_ERROR(frameParameter_unsupported, "this mode is not compatible with frame checksum");
     }
index 68e78b3cac00c1835f3c5375677596dcb2f1e282..feb1ae17acab2c7aecfd7e00f2a31c722a504570 100644 (file)
@@ -1674,7 +1674,8 @@ ZSTD_compressSequences(ZSTD_CCtx* cctx,
  * It's a speed optimization, useful when the right conditions are met,
  * but it also features the following limitations:
  * - Only supports explicit delimiter mode
- * - Not compatible with frame checksum, which must disabled
+ * - Currently does not support Sequences validation (so input Sequences are trusted)
+ * - Not compatible with frame checksum, which must be disabled
  * - If any block is incompressible, will fail and return an error
  * - @litSize must be == sum of all @.litLength fields in @inSeqs. Any discrepancy will generate an error.
  * - the buffer @literals must be larger than @litSize by at least 8 bytes.