m_option: fix -vo opengl lscale validation

OPT_STRING_VALIDATE actually did nothing. This made -vo opengl crash or
misbehave when passing an invalid value for the lscale, cscale or 3dlut-
size (the only users for this option type).

The code added with this commit was either blatantly forgotten with the
commit introducing this option type, or somehow lost.
This commit is contained in:
wm4 2013-05-31 21:22:06 +02:00
parent e9af899237
commit 07fc939544
1 changed files with 7 additions and 0 deletions

View File

@ -762,6 +762,13 @@ static int parse_str(const m_option_t *opt, struct bstr name,
goto exit;
}
m_opt_string_validate_fn validate = opt->priv;
if (validate) {
r = validate(opt, name, param);
if (r < 0)
goto exit;
}
if (opt->flags & M_OPT_PARSE_ESCAPES) {
char *res = unescape_string(tmp, param);
if (!res) {