mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 13:32:16 +00:00
scripting: fix racy crash if loading .run files fails
args->client was deallocated if the FDs were closed and nothing referenced it (IPC socket codes detected the closed sockets and asynchronously killed the mpv_handle in args->client). The problem was that args->log depended on it, and was also destroyed. Fix this by duplicating the mp_log.
This commit is contained in:
parent
322eb72679
commit
c43fd88f59
@ -328,6 +328,9 @@ const struct mp_scripting mp_scripting_cplugin = {
|
||||
|
||||
static int load_run(struct mp_script_args *args)
|
||||
{
|
||||
// The arg->client object might die and with it args->log, so duplicate it.
|
||||
args->log = mp_log_new(args, args->log, NULL);
|
||||
|
||||
int fds[2];
|
||||
if (!mp_ipc_start_anon_client(args->mpctx->ipc_ctx, args->client, fds))
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user