changeset 27094:bafda9ff0221

Only use application font dir if library->fonts_dir is not NULL. This can be the case if ass_set_fonts_dir() call is omitted, results in segfault. Never happens in the current MPlayer.
author eugeni
date Mon, 23 Jun 2008 14:46:50 +0000
parents 795a1325f915
children a0e00d065593
files libass/ass_fontconfig.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_fontconfig.c	Mon Jun 23 08:58:25 2008 +0000
+++ b/libass/ass_fontconfig.c	Mon Jun 23 14:46:50 2008 +0000
@@ -423,6 +423,7 @@
 	for (i = 0; i < library->num_fontdata; ++i)
 		process_fontdata(priv, library, ftlibrary, i);
 
+	if (dir) {
 	if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
 	{
 		mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache);
@@ -461,6 +462,7 @@
 	if (!rc) {
 		mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcConfigAppFontAddDirFailed);
 	}
+	}
 
 	priv->family_default = family ? strdup(family) : 0;
 	priv->path_default = path ? strdup(path) : 0;