summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-07-09 20:02:34 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-07-09 20:02:34 +0300
commit06c533b167c37540b578fb1c70d2acb44ce59245 (patch)
tree1fa9170c432a1ff3769a4d7296bdf5d7638c6ffa /mplayer.c
parentca3feba5c339f12141bf335e5592967caccc290b (diff)
downloadmpv-06c533b167c37540b578fb1c70d2acb44ce59245.tar.bz2
mpv-06c533b167c37540b578fb1c70d2acb44ce59245.tar.xz
Fix crash during early exit
Starting MPlayer with options such as "-demuxer help" that exit before initializing OSD struct would crash at exit because of a reference to mpctx->osd->sub_font in deinitialization code. Fix by checking that mpctx->osd is not NULL. Checking that osd->sub_font is not NULL was unnecessary because free_font_desc(NULL) is safe.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mplayer.c b/mplayer.c
index 3c487d3be6..eb50e37ea2 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -670,9 +670,9 @@ void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc){
#ifdef HAVE_FREETYPE
current_module="uninit_font";
- if (mpctx->osd->sub_font && mpctx->osd->sub_font != vo_font) free_font_desc(mpctx->osd->sub_font);
- mpctx->osd->sub_font = NULL;
- if (vo_font) free_font_desc(vo_font);
+ if (mpctx->osd && mpctx->osd->sub_font != vo_font)
+ free_font_desc(mpctx->osd->sub_font);
+ free_font_desc(vo_font);
vo_font = NULL;
done_freetype();
#endif