From 07fc9395445b9fcb37e90de1c8ca2d5c93aaca3b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 May 2013 21:22:06 +0200 Subject: 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. --- core/m_option.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/m_option.c b/core/m_option.c index 931b498213..406e4ede0b 100644 --- a/core/m_option.c +++ b/core/m_option.c @@ -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) { -- cgit v1.2.3