mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 15:11:09 +08:00
command: fix null dereference for invalid command in input-commands
mp_input_parse_cmd can return NULL. --input-commands=x segfaults with
null dereference. Fix this by adding null check.
Fixes: 533a684381
This commit is contained in:
+4
-2
@@ -7789,8 +7789,10 @@ void run_command_opts(struct MPContext *mpctx)
|
||||
for (int i = 0; opts->input_commands[i]; i++) {
|
||||
struct mp_cmd *cmd = mp_input_parse_cmd(mpctx->input, bstr0(opts->input_commands[i]),
|
||||
"the command line");
|
||||
cmd->coalesce = true;
|
||||
mp_input_queue_cmd(mpctx->input, cmd);
|
||||
if (cmd) {
|
||||
cmd->coalesce = true;
|
||||
mp_input_queue_cmd(mpctx->input, cmd);
|
||||
}
|
||||
}
|
||||
ctx->command_opts_processed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user