summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-27 12:24:44 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:13 +0900
commitebd4bf979297e157adf4159e765d9509ff367552 (patch)
tree2080e48395656fe9ed24caff304a257fcf2966fa
parentab4c857ff6023397d8299607f97ab251d8b7d809 (diff)
downloadmpv-ebd4bf979297e157adf4159e765d9509ff367552.tar.bz2
mpv-ebd4bf979297e157adf4159e765d9509ff367552.tar.xz
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.
-rw-r--r--player/sub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/sub.c b/player/sub.c
index bc9759e3e5..30dc25a792 100644
--- a/player/sub.c
+++ b/player/sub.c
@@ -148,6 +148,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);
}
}