summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2018-09-28 23:58:01 (GMT)
committerGitHub <noreply@github.com>2018-09-28 23:58:01 (GMT)
commitb18b6e53e16258cbdc4c24a387d9d4338006f827 (patch)
tree37de87108d6f856b123952a966a7582754fa550d /lib
parent48cd25a4b33e2d06995c43250958a1c0c9f44831 (diff)
parent21120549a7f35f924a66c7c071d0f5c69cf7e08a (diff)
downloadlz4-b18b6e53e16258cbdc4c24a387d9d4338006f827.zip
lz4-b18b6e53e16258cbdc4c24a387d9d4338006f827.tar.gz
lz4-b18b6e53e16258cbdc4c24a387d9d4338006f827.tar.bz2
Merge pull request #587 from lz4/hintbug
fixed improper hint
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4frame.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index 11e0975..547afa3 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -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;