summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2019-04-26 03:26:04 (GMT)
committerGitHub <noreply@github.com>2019-04-26 03:26:04 (GMT)
commitce55e7eef9ae60f11f8a8552a9dcde8ab6b99559 (patch)
tree53abcab66d6e862386b336d290d47e5ff4a5022c
parent8453e071f14784b2bc132e935e14a315e54b775c (diff)
parent9e056bc032c1f1b425bbfc6034be75f595d8cffe (diff)
downloadlz4-ce55e7eef9ae60f11f8a8552a9dcde8ab6b99559.zip
lz4-ce55e7eef9ae60f11f8a8552a9dcde8ab6b99559.tar.gz
lz4-ce55e7eef9ae60f11f8a8552a9dcde8ab6b99559.tar.bz2
Merge pull request #699 from brendene/compressBound
Include block checksum in worst case scenario calculation of dstCapacity
-rw-r--r--lib/lz4frame.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index a10e4af..f131d9a 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -327,6 +327,7 @@ static size_t LZ4F_compressBound_internal(size_t srcSize,
{
LZ4F_preferences_t prefsNull = LZ4F_INIT_PREFERENCES;
prefsNull.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; /* worst case */
+ prefsNull.frameInfo.blockChecksumFlag = LZ4F_blockChecksumEnabled; /* worst case */
{ const LZ4F_preferences_t* const prefsPtr = (preferencesPtr==NULL) ? &prefsNull : preferencesPtr;
U32 const flush = prefsPtr->autoFlush | (srcSize==0);
LZ4F_blockSizeID_t const blockID = prefsPtr->frameInfo.blockSizeID;