summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-02-02 17:22:05 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-03 05:01:32 -0800
commit2e8bb48ae8de57181b788525f2fdf6fca8461e5f (patch)
tree00dd214c1d106b5f413e5ac5b3be55ae5c82d0b6
parent34fe10e1593920879c5d6c69b43abcf402d50fdc (diff)
downloadmpv-2e8bb48ae8de57181b788525f2fdf6fca8461e5f.tar.bz2
mpv-2e8bb48ae8de57181b788525f2fdf6fca8461e5f.tar.xz
loadfile: fix crash in some cases of setting --lavfi-complex at runtime
The somewhat confusing thing is that many filters (including track->dec) have a public struct, but to free them, you need to free the mp_filter pointer itself (track->dec->f). The assignment wrote to a dangling pointer, instead of removing the dangling pointer. (Other than that, this idiom is actually nice.)
-rw-r--r--player/loadfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 758af41f89..c435f50b7d 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -985,7 +985,7 @@ static void cleanup_deassociated_complex_filters(struct MPContext *mpctx)
if (!(track->sink || track->vo_c || track->ao_c)) {
if (track->dec && !track->vo_c && !track->ao_c) {
talloc_free(track->dec->f);
- track->dec->f = NULL;
+ track->dec = NULL;
}
track->selected = false;
}