mirror of
https://github.com/facebook/zstd.git
synced 2025-11-30 00:03:21 -05:00
ensure lastBlock is correctly determined
reported by @terrelln
This commit is contained in:
parent
7bad787d8b
commit
5ae34e4c96
@ -4540,8 +4540,8 @@ static size_t ZSTD_compress_frameChunk(ZSTD_CCtx* cctx,
|
|||||||
|
|
||||||
while (remaining) {
|
while (remaining) {
|
||||||
ZSTD_matchState_t* const ms = &cctx->blockState.matchState;
|
ZSTD_matchState_t* const ms = &cctx->blockState.matchState;
|
||||||
U32 const lastBlock = lastFrameChunk & (blockSizeMax >= remaining);
|
|
||||||
size_t const blockSize = ZSTD_optimalBlockSize(cctx, ip, remaining, blockSizeMax, cctx->appliedParams.cParams.strategy, savings);
|
size_t const blockSize = ZSTD_optimalBlockSize(cctx, ip, remaining, blockSizeMax, cctx->appliedParams.cParams.strategy, savings);
|
||||||
|
U32 const lastBlock = lastFrameChunk & (blockSize == remaining);
|
||||||
assert(blockSize <= remaining);
|
assert(blockSize <= remaining);
|
||||||
|
|
||||||
/* TODO: See 3090. We reduced MIN_CBLOCK_SIZE from 3 to 2 so to compensate we are adding
|
/* TODO: See 3090. We reduced MIN_CBLOCK_SIZE from 3 to 2 so to compensate we are adding
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user