From 6e4ea0ff1a529780ad3267227ff1a0f6555815aa Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 17 Jun 2019 11:44:00 +0200 Subject: [PATCH] libvlc: player: detach listener on destroy Fix possible segfault, when receiving the preparsed event after the libvlc_media_t instance was deleted. Signed-off-by: Jean-Baptiste Kempf --- lib/media_player.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/media_player.c b/lib/media_player.c index 4ec277034c..667ec517d0 100644 --- a/lib/media_player.c +++ b/lib/media_player.c @@ -795,6 +795,8 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi ) vlc_player_Delete(p_mi->player); + if (p_mi->p_md) + media_detach_preparsed_event(p_mi->p_md); libvlc_event_manager_destroy(&p_mi->event_manager); libvlc_media_release( p_mi->p_md ); -- 2.11.4.GIT