1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 22:49:58 +00:00

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.
This commit is contained in:
wm4 2014-12-27 12:24:44 +01:00 committed by Diogo Franco (Kovensky)
parent ab4c857ff6
commit ebd4bf9792

View File

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