1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 15:22:09 +00:00

player: fix use-after-free with --screenshot-directory

Probably fixes #3049.
This commit is contained in:
wm4 2016-04-14 22:39:10 +02:00
parent e13cc25a2c
commit 4ebac1e936

View File

@ -287,9 +287,10 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
void *t = fname; void *t = fname;
dir = mp_get_user_path(t, ctx->mpctx->global, dir); dir = mp_get_user_path(t, ctx->mpctx->global, dir);
fname = mp_path_join(NULL, dir, fname); fname = mp_path_join(NULL, dir, fname);
talloc_free(t);
mp_mkdirp(dir); mp_mkdirp(dir);
talloc_free(t);
} }
if (!mp_path_exists(fname)) if (!mp_path_exists(fname))