Skip to content

Commit

Permalink
player: fix random crashes on uninitialization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wm4 committed Dec 27, 2014
1 parent 6659de7 commit 77a4a87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions player/sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 77a4a87

Please sign in to comment.