aboutsummaryrefslogtreecommitdiff
path: root/lib/lz4frame.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-04-14 18:51:36 +0100
committerYann Collet <yann.collet.73@gmail.com>2015-04-14 18:51:36 +0100
commit05a46fc59ab0934389055f97b7be5b5a6da2824d (patch)
treea38fee9efa394b674986bbd031795eac37fc2120 /lib/lz4frame.c
parent348f5099e42c23393ec9c8e6b403f4bca99bbb41 (diff)
downloadlz4-05a46fc59ab0934389055f97b7be5b5a6da2824d.tar.gz
Changes LZ4F_compressBound() definition using NULL prefsPtr to cover worst case instead of default.
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r--lib/lz4frame.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index 31cf9a56..8d4c029b 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -472,12 +472,13 @@ size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* ds
/* LZ4F_compressBound() : gives the size of Dst buffer given a srcSize to handle worst case situations.
* The LZ4F_frameInfo_t structure is optional :
-* you can provide NULL as argument, all preferences will then be set to default.
+* you can provide NULL as argument, preferences will then be set to cover worst case situations.
* */
size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr)
{
LZ4F_preferences_t prefsNull;
memset(&prefsNull, 0, sizeof(prefsNull));
+ prefsNull.frameInfo.contentChecksumFlag = contentChecksumEnabled; /* worst case */
{
const LZ4F_preferences_t* prefsPtr = (preferencesPtr==NULL) ? &prefsNull : preferencesPtr;
blockSizeID_t bid = prefsPtr->frameInfo.blockSizeID;