1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

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.
This commit is contained in:
Uoti Urpala 2008-07-09 20:02:34 +03:00
parent ca3feba5c3
commit 06c533b167

View File

@ -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