mirror of https://github.com/mpv-player/mpv
command: fix potential UB
Pointed out by quilloss on github.
This commit is contained in:
parent
caa14e3d45
commit
6f6c4a57ec
|
@ -290,11 +290,6 @@ int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flag
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int n = 0; no_property[n]; n++) {
|
|
||||||
if (strcmp(co->name, no_property[n]) == 0)
|
|
||||||
goto direct_option;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normalize "vf*" to "vf"
|
// Normalize "vf*" to "vf"
|
||||||
const char *name = co->name;
|
const char *name = co->name;
|
||||||
bstr bname = bstr0(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;
|
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};
|
struct m_option type = {0};
|
||||||
|
|
||||||
int r = mp_property_do_silent(name, M_PROPERTY_GET_TYPE, &type, mpctx);
|
int r = mp_property_do_silent(name, M_PROPERTY_GET_TYPE, &type, mpctx);
|
||||||
|
|
Loading…
Reference in New Issue