ZSTD_CCtx_setParameter() only works during initialization stage
and generate a stage_wrong error otherwise.
This commit is contained in:
parent
48855fa0d2
commit
334a288d0d
@ -223,7 +223,14 @@ static void ZSTD_cLevelToCParams(ZSTD_CCtx* cctx)
|
||||
|
||||
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value)
|
||||
{
|
||||
# define CLAMPCHECK(val,min,max) { if ((val<min) | (val>max)) return ERROR(compressionParameter_unsupported); }
|
||||
# define CLAMPCHECK(val,min,max) { \
|
||||
if ((val<min) | (val>max)) { \
|
||||
return ERROR(compressionParameter_unsupported); \
|
||||
} }
|
||||
|
||||
if (cctx->streamStage != zcss_init) {
|
||||
return ERROR(stage_wrong);
|
||||
}
|
||||
|
||||
switch(param)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user