1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00

input: fix off by one error in command parser

Should fix #989.
This commit is contained in:
wm4 2014-08-07 18:21:36 +02:00
parent 886ac09699
commit 5906041343

View File

@ -306,7 +306,7 @@ struct mp_cmd *mp_input_parse_cmd_strv(struct mp_log *log, int def_flags,
bstr args[MP_CMD_MAX_ARGS];
int num = 0;
for (; argv[num]; num++) {
if (num > MP_CMD_MAX_ARGS) {
if (num >= MP_CMD_MAX_ARGS) {
mp_err(log, "%s: too many arguments.\n", location);
return NULL;
}