coalesce block+header size (buffered mode)

This commit is contained in:
Yann Collet 2015-11-27 13:26:38 +01:00
parent d248aa1c62
commit 944042ab7d

View File

@ -523,7 +523,12 @@ size_t ZBUFF_decompressContinue(ZBUFF_DCtx* zbc, void* dst, size_t* maxDstSizePt
*srcSizePtr = ip-istart;
*maxDstSizePtr = op-ostart;
return ZSTD_nextSrcSizeToDecompress(zbc->zc) - zbc->inPos;
{
size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zbc->zc);
if (nextSrcSizeHint > 3) nextSrcSizeHint+= 3; /* get the next block header while at it */
nextSrcSizeHint -= zbc->inPos; /* already loaded*/
return nextSrcSizeHint;
}
}