summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-31 21:22:06 +0200
committerwm4 <wm4@nowhere>2013-06-03 00:00:11 +0200
commit07fc9395445b9fcb37e90de1c8ca2d5c93aaca3b (patch)
tree9103c134af982e95bd703a0e9eb7007712dad208 /core
parente9af8992374c3c7193a0cf1508f4d5f436a56064 (diff)
downloadmpv-07fc9395445b9fcb37e90de1c8ca2d5c93aaca3b.tar.bz2
mpv-07fc9395445b9fcb37e90de1c8ca2d5c93aaca3b.tar.xz
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.
Diffstat (limited to 'core')
-rw-r--r--core/m_option.c7
1 files changed, 7 insertions, 0 deletions
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) {