]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
macro compatible with scenario where windowSize = 1024 (minimum)
authorYann Collet <cyan@fb.com>
Sat, 30 Sep 2017 22:34:44 +0000 (15:34 -0700)
committerYann Collet <cyan@fb.com>
Sat, 30 Sep 2017 22:34:44 +0000 (15:34 -0700)
lib/zstd.h

index 5f3c0585f6be15be1f377cbc6a8b9570512bc0bb..02491ed40154e4bbae15ba27dcf5dbdf57c80e94 100644 (file)
@@ -131,7 +131,7 @@ ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t
 
 
 /*======  Helper functions  ======*/
-#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>9) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))
+#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))
 ZSTDLIB_API size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */
 ZSTDLIB_API unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */
 ZSTDLIB_API const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */