added minimum for decoder buffer

also : introduced macro BOUNDED()
This commit is contained in:
Yann Collet
2021-10-26 08:21:31 -07:00
parent 02be2a830f
commit 518f06b281
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -1123,7 +1123,7 @@ static size_t ZSTD_nextSrcSizeToDecompressWithInputSize(ZSTD_DCtx* dctx, size_t
return dctx->expected;
if (dctx->bType != bt_raw)
return dctx->expected;
return MIN(MAX(inputSize, 1), dctx->expected);
return BOUNDED(1, inputSize, dctx->expected);
}
ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) {