input: fix locking of mp_input_bind_key

This is a public function, yet its access to ictx through
get_bind_section is not locked.

Fixes: 4614d432a8
This commit is contained in:
nanahi 2024-04-03 23:42:58 -04:00 committed by Kacper Michajłow
parent 7b181c989e
commit ce4294bc37
1 changed files with 2 additions and 0 deletions

View File

@ -1459,6 +1459,7 @@ void mp_input_run_cmd(struct input_ctx *ictx, const char **cmd)
void mp_input_bind_key(struct input_ctx *ictx, int key, bstr command)
{
input_lock(ictx);
struct cmd_bind_section *bs = get_bind_section(ictx, (bstr){0});
struct cmd_bind *bind = NULL;
@ -1493,6 +1494,7 @@ void mp_input_bind_key(struct input_ctx *ictx, int key, bstr command)
bind->cmd, bind->location);
talloc_free(s);
}
input_unlock(ictx);
}
struct mpv_node mp_input_get_bindings(struct input_ctx *ictx)