From 77a4a87e7eb822cefe07bfed5394a13e97faddbb Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Dec 2014 12:24:44 +0100 Subject: player: fix random crashes on uninitialization On uninitialization, the player will unselect all subtitles, and then destroy the subtitle decoder. But it didn't correctly remove the subtitle decoder from the OSD state, so it could happen that it would access it after the decoder was destroyed. Could lead to random crashes when switching files often. Fixes #1389. --- player/sub.c | 1 + 1 file changed, 1 insertion(+) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 26c25b5f10..f2738864f3 100644 --- a/player/sub.c +++ b/player/sub.c @@ -163,6 +163,7 @@ void uninit_sub(struct MPContext *mpctx, int order) if (mpctx->d_sub[order]) { reset_subtitles(mpctx, order); mpctx->d_sub[order] = NULL; // Note: not free'd. + update_osd_sub_state(mpctx, order, NULL); // unset reselect_demux_streams(mpctx); } } -- cgit v1.2.3