summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-11 13:00:57 +0200
committerwm4 <wm4@nowhere>2014-08-11 13:00:57 +0200
commitb016f92309403fbd3598e70699464692de8e8f4b (patch)
tree3d7adcfde3de9720c797d1905f6e43774a56c18f
parentece61bfa100ae4af032bea6ce9ffb6da86126525 (diff)
downloadmpv-b016f92309403fbd3598e70699464692de8e8f4b.tar.bz2
mpv-b016f92309403fbd3598e70699464692de8e8f4b.tar.xz
command: fix dangling pointer issue in script key bindings code
This code was sending a string to a different thread, and then deallocated the string shortly after, which means most of the time the other thread was accessing a dangling pointer. It's possible that this is the cause for #1002.
-rw-r--r--player/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 270798d925..cae7e02805 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3894,7 +3894,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
*event = (mpv_event_client_message){0};
for (int n = 1; n < cmd->nargs; n++) {
MP_TARRAY_APPEND(event, event->args, event->num_args,
- cmd->args[n].v.s);
+ talloc_strdup(event, cmd->args[n].v.s));
}
if (mp_client_send_event(mpctx, cmd->args[0].v.s,
MPV_EVENT_CLIENT_MESSAGE, event) < 0)