From: Bimba Shrestha Date: Tue, 19 Nov 2019 18:03:07 +0000 (-0800) Subject: Going back to original flow but removing else return X-Git-Tag: v1.4.5^2~132^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f0c2d04c8a5ff3e94169ac22c56c9efca7a7154;p=thirdparty%2Fzstd.git Going back to original flow but removing else return --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 6330b8821..064a38ffc 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2480,13 +2480,11 @@ static size_t ZSTD_compressBlock_targetCBlockSize(ZSTD_CCtx* zc, * enough for SuperBlock compression. * In such case, fall back to normal compression. This is possible because * targetCBlockSize is best effort not a guarantee. */ - if (cSize != ERROR(dstSize_tooSmall) && (dstCapacity - cSize) >= 4) + if (cSize == ERROR(dstSize_tooSmall) || (dstCapacity - cSize) < 4) { /* We check (dstCapacity - cSize) >= 4 above because we have to make sure * to leave enough room for the checksum that will eventually get added in * the epilogue. Otherwise, we're just going to throw the dstSize_tooSmall * error there instead of here */ - return cSize; - else { BYTE* const ostart = (BYTE*)dst; /* If ZSTD_noCompressSuperBlock fails with dstSize_tooSmall, * compress normally.