mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
minor: use MEM_writeLE24()
so that an empty frame needs only 3 bytes of dstCapacity.
This commit is contained in:
parent
b7a9e69d8d
commit
522adc34eb
1 changed files with 2 additions and 2 deletions
|
|
@ -7213,8 +7213,8 @@ ZSTD_compressSequencesAndLiterals_internal(ZSTD_CCtx* cctx,
|
|||
/* Special case: empty frame */
|
||||
if ((nbSequences == 1) && (inSeqs[0].litLength == 0)) {
|
||||
U32 const cBlockHeader24 = 1 /* last block */ + (((U32)bt_raw)<<1);
|
||||
RETURN_ERROR_IF(dstCapacity<4, dstSize_tooSmall, "No room for empty frame block header");
|
||||
MEM_writeLE32(op, cBlockHeader24);
|
||||
RETURN_ERROR_IF(dstCapacity<3, dstSize_tooSmall, "No room for empty frame block header");
|
||||
MEM_writeLE24(op, cBlockHeader24);
|
||||
op += ZSTD_blockHeaderSize;
|
||||
dstCapacity -= ZSTD_blockHeaderSize;
|
||||
cSize += ZSTD_blockHeaderSize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue