cctx->blockState.matchState.cParams = params.cParams;
cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1;
cctx->consumedSrcSize = 0;
- cctx->isFirstBlock = 1;
cctx->producedCSize = 0;
if (pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN)
cctx->appliedParams.fParams.contentSizeFlag = 0;
(U32)pledgedSrcSize, params.cParams.windowLog);
assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
- zc->isFirstBlock = 1;
if (crp == ZSTDcrp_continue) {
if (ZSTD_equivalentParams(zc->appliedParams, params,
zc->inBuffSize,
zc->bmi2);
if (frame &&
- /* We don't want to emit our first block as a RLE even if it qualifies because
- * doing so will cause the decoder to throw a "should consume all input error."
- * https://github.com/facebook/zstd/blob/dev/programs/fileio.c#L1723
- */
- !zc->isFirstBlock &&
cSize < rleMaxLength &&
ZSTD_isRLE(ip, srcSize))
{
op += cSize;
assert(dstCapacity >= cSize);
dstCapacity -= cSize;
- cctx->isFirstBlock = 0;
DEBUGLOG(5, "ZSTD_compress_frameChunk: adding a block of size %u",
(unsigned)cSize);
} }
}
if (readSizeHint == 0) break; /* end of frame */
- if (inBuff.size != inBuff.pos) {
- DISPLAYLEVEL(1, "%s : Decoding error (37) : should consume entire input \n",
- srcFileName);
- return FIO_ERROR_FRAME_DECODING;
- }
/* Fill input buffer */
{ size_t const toDecode = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */