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:
wm4 2018-02-02 17:22:05 +01:00 committed by Kevin Mitchell
parent 34fe10e159
commit 2e8bb48ae8
No known key found for this signature in database
GPG Key ID: 559A34B46A917232
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}