mirror of https://github.com/mpv-player/mpv
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.)
This commit is contained in:
parent
34fe10e159
commit
2e8bb48ae8
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue