diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-04-03 23:42:58 -0400 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-17 23:42:35 +0200 |
commit | ce4294bc37d7377a514204fd7a087349b2415836 (patch) | |
tree | 399289fca38abe354cc0dc2f63003b1e2452f4dc | |
parent | 7b181c989e1f77a4d0bd178d2f474bfa13e5690d (diff) | |
download | mpv-ce4294bc37d7377a514204fd7a087349b2415836.tar.bz2 mpv-ce4294bc37d7377a514204fd7a087349b2415836.tar.xz |
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: 4614d432a8d21ab135af25a183f57efd5059bb62
-rw-r--r-- | input/input.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c index 9fd2a16f0c..7ddd7df262 100644 --- a/input/input.c +++ b/input/input.c @@ -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) |