added parameter litCapacity
to ZSTD_compressSequencesAndLiterals() to enforce the litCapacity >= litSize+8 condition.
This commit is contained in:
@@ -1421,7 +1421,8 @@ ZSTD_compressSequences(ZSTD_CCtx* cctx,
|
||||
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);
|
||||
</b><p> This is a variant of ZSTD_compressSequences() which,
|
||||
instead of receiving (src,srcSize) as input parameter, receives (literals,litSize),
|
||||
aka all the literals, already extracted and laid out into a single continuous buffer.
|
||||
@@ -1434,7 +1435,8 @@ ZSTD_compressSequencesAndLiterals(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.
|
||||
|
||||
</p></pre><BR>
|
||||
|
||||
Reference in New Issue
Block a user