From: Yann Collet Date: Tue, 13 Sep 2016 22:16:07 +0000 (+0200) Subject: Fixed srcSize=1 X-Git-Tag: v1.1.0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64deef3bee9a5235191ff31d446be6f1e591a4b2;p=thirdparty%2Fzstd.git Fixed srcSize=1 --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index f832e081a..1d59279e3 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -168,7 +168,7 @@ ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, u { U32 const minSrcSize = (srcSize==0) ? 500 : 0; U64 const rSize = srcSize + dictSize + minSrcSize; if (rSize < ((U64)1< srcLog) cPar.windowLog = srcLog; } } if (cPar.hashLog > cPar.windowLog) cPar.hashLog = cPar.windowLog; diff --git a/lib/zstd.h b/lib/zstd.h index a8b2de124..6e3d43596 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -50,7 +50,7 @@ ZSTDLIB_API unsigned ZSTD_versionNumber (void); /*! ZSTD_compress() : Compresses `src` content as a single zstd compressed frame into already allocated `dst`. Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`. - @return : the number of bytes written into `dst` (<= `dstCapacity), + @return : compressed size written into `dst` (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()) */ ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity, const void* src, size_t srcSize, diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 323854b32..b8f102a9c 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -57,7 +57,7 @@ static U32 g_displayLevel = 2; if ((FUZ_clockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \ { g_displayClock = clock(); DISPLAY(__VA_ARGS__); \ if (g_displayLevel>=4) fflush(stdout); } } -static const clock_t g_refreshRate = CLOCKS_PER_SEC * 150 / 1000; +static const clock_t g_refreshRate = CLOCKS_PER_SEC / 6; static clock_t g_displayClock = 0;