From: Yann Collet Date: Mon, 4 Dec 2017 19:26:59 +0000 (-0800) Subject: fileio: fixed LZ4F invocation from assert() X-Git-Tag: v1.3.3^2~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55faa5492d5ba593746868991556e593134e6b57;p=thirdparty%2Fzstd.git fileio: fixed LZ4F invocation from assert() --- diff --git a/programs/fileio.c b/programs/fileio.c index c9b6b04e1..101c99b1a 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -639,7 +639,6 @@ static unsigned long long FIO_compressLz4Frame(cRess_t* ress, memset(&prefs, 0, sizeof(prefs)); assert(blockSize <= ress->srcBufferSize); - assert(LZ4F_compressBound(blockSize) <= ress->dstBufferSize); prefs.autoFlush = 1; prefs.compressionLevel = compressionLevel; @@ -649,6 +648,7 @@ static unsigned long long FIO_compressLz4Frame(cRess_t* ress, #if LZ4_VERSION_NUMBER >= 10600 prefs.frameInfo.contentSize = (srcFileSize==UTIL_FILESIZE_UNKNOWN) ? 0 : srcFileSize; #endif + assert(LZ4F_compressBound(blockSize, &prefs) <= ress->dstBufferSize); { size_t readSize;