Merge pull request #587 from lz4/hintbug

fixed improper hint
This commit is contained in:
Yann Collet 2018-09-28 16:58:01 -07:00 committed by GitHub
commit b18b6e53e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1474,7 +1474,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctx,
}
dctx->tmpInTarget -= sizeToCopy; /* need to copy more */
nextSrcSizeHint = dctx->tmpInTarget +
+ dctx->frameInfo.contentChecksumFlag * 4 /* block checksum */
+ dctx->frameInfo.blockChecksumFlag * 4 /* size for block checksum */
+ BHSize /* next header size */;
doAnotherStage = 0;
break;
@ -1525,8 +1525,10 @@ size_t LZ4F_decompress(LZ4F_dctx* dctx,
dctx->tmpInSize += sizeToCopy;
srcPtr += sizeToCopy;
if (dctx->tmpInSize < dctx->tmpInTarget) { /* need more input */
nextSrcSizeHint = (dctx->tmpInTarget - dctx->tmpInSize) + BHSize;
doAnotherStage=0;
nextSrcSizeHint = (dctx->tmpInTarget - dctx->tmpInSize)
+ dctx->frameInfo.blockChecksumFlag * 4 /* size for block checksum */
+ BHSize /* next header size */;
doAnotherStage = 0;
break;
}
selectedIn = dctx->tmpIn;