summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-23 15:21:59 +0200
committerwm4 <wm4@nowhere>2016-09-23 15:21:59 +0200
commit6f6c4a57ec11dc75828d3eaa8422936e912e9bb5 (patch)
treef2f416ef7e0d92d7e95bb0bf2f4e12a07bd49729 /player
parentcaa14e3d45cc816d85d7ce0167b97a5ea3fbd794 (diff)
downloadmpv-6f6c4a57ec11dc75828d3eaa8422936e912e9bb5.tar.bz2
mpv-6f6c4a57ec11dc75828d3eaa8422936e912e9bb5.tar.xz
command: fix potential UB
Pointed out by quilloss on github.
Diffstat (limited to 'player')
-rw-r--r--player/command.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 5983059448..afc556e3eb 100644
--- a/player/command.c
+++ b/player/command.c
@@ -290,11 +290,6 @@ int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flag
NULL
};
- for (int n = 0; no_property[n]; n++) {
- if (strcmp(co->name, no_property[n]) == 0)
- goto direct_option;
- }
-
// Normalize "vf*" to "vf"
const char *name = co->name;
bstr bname = bstr0(name);
@@ -304,6 +299,11 @@ int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flag
name = tmp;
}
+ for (int n = 0; no_property[n]; n++) {
+ if (strcmp(co->name, no_property[n]) == 0)
+ goto direct_option;
+ }
+
struct m_option type = {0};
int r = mp_property_do_silent(name, M_PROPERTY_GET_TYPE, &type, mpctx);