From: Yann Collet Date: Tue, 4 May 2021 22:59:27 +0000 (-0700) Subject: fix rsyncable mode X-Git-Tag: v1.5.0^2~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1026b9fa1074e480fb80c16a16b71bd2536e1cf0;p=thirdparty%2Fzstd.git fix rsyncable mode --- diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 5f822da44..cfd75cc49 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -1240,9 +1240,8 @@ size_t ZSTDMT_initCStream_internal( if (params.rsyncable) { /* Aim for the targetsectionSize as the average job size. */ - U32 const jobSizeMB = (U32)(mtctx->targetSectionSize >> 20); - U32 const rsyncBits = ZSTD_highbit32(jobSizeMB) + 20; - assert(jobSizeMB >= 1); + U32 const jobSizeKB = (U32)(mtctx->targetSectionSize >> 10); + U32 const rsyncBits = (assert(jobSizeKB >= 1), ZSTD_highbit32(jobSizeKB) + 10); DEBUGLOG(4, "rsyncLog = %u", rsyncBits); mtctx->rsync.hash = 0; mtctx->rsync.hitMask = (1ULL << rsyncBits) - 1;