Include block checksum in worst case scenario calculation of dstCapacity

This commit is contained in:
Brenden Eng 2019-04-25 22:37:39 -04:00
parent 8453e071f1
commit 9e056bc032

View File

@ -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;