diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-07-09 20:02:34 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-07-09 20:02:34 +0300 |
commit | 06c533b167c37540b578fb1c70d2acb44ce59245 (patch) | |
tree | 1fa9170c432a1ff3769a4d7296bdf5d7638c6ffa /mplayer.c | |
parent | ca3feba5c339f12141bf335e5592967caccc290b (diff) | |
download | mpv-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |