mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Added check if max-merge is out of bounds
This commit is contained in:
parent
2a40560888
commit
7f4e0acf41
10
src/cfg.c
10
src/cfg.c
|
@ -1228,8 +1228,14 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
|
|||
}
|
||||
else if (OPT("fast-residual-cost"))
|
||||
cfg->fast_residual_cost_limit = atoi(value);
|
||||
else if (OPT("max-merge"))
|
||||
cfg->max_merge = atoi(value);
|
||||
else if (OPT("max-merge")) {
|
||||
int max_merge = atoi(value);
|
||||
if (max_merge < 1 || max_merge > 5) {
|
||||
fprintf(stderr, "max-merge needs to be between 1 and 5\n");
|
||||
return 0;
|
||||
}
|
||||
cfg->max_merge = (uint8_t)max_merge;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue