added parameter litCapacity

to ZSTD_compressSequencesAndLiterals()
to enforce the litCapacity >= litSize+8 condition.
This commit is contained in:
Yann Collet
2024-12-20 10:37:01 -08:00
parent 76445bb379
commit b7a9e69d8d
5 changed files with 23 additions and 15 deletions
+4 -2
View File
@@ -1678,14 +1678,16 @@ ZSTD_compressSequences(ZSTD_CCtx* cctx,
* - 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.
* - the buffer @literals must have a size @litCapacity which is larger than @litSize by at least 8 bytes.
* - @decompressedSize must be correct, and correspond to the sum of all Sequences. Any discrepancy will generate an error.
* @return : final compressed size, or a ZSTD error code.
*/
ZSTDLIB_STATIC_API size_t
ZSTD_compressSequencesAndLiterals(ZSTD_CCtx* cctx,
void* dst, size_t dstCapacity,
const ZSTD_Sequence* inSeqs, size_t nbSequences,
const void* literals, size_t litSize, size_t srcSize);
const void* literals, size_t litSize, size_t litCapacity,
size_t decompressedSize);
/*! ZSTD_writeSkippableFrame() :