summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-01 14:33:08 +0200
committerwm4 <wm4@nowhere>2015-09-01 14:33:08 +0200
commitdf9ec6e99ff5b843b84de2f0df7b18f97ce36c35 (patch)
treebc15b9e278377616d92a3f4911c0b4441330214b
parent7e875e5e17f8ef0a13f84d7ce3aabef592f5689e (diff)
downloadlibass-df9ec6e99ff5b843b84de2f0df7b18f97ce36c35.tar.bz2
libass-df9ec6e99ff5b843b84de2f0df7b18f97ce36c35.tar.xz
fontselect: never pass family=NULL to get_fallback()
The CoreText backend doesn't like this, and in fact there's no reason to pass NULL.
-rw-r--r--libass/ass_fontselect.c3
-rw-r--r--libass/ass_fontselect.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c
index 4adb146..ebe71ba 100644
--- a/libass/ass_fontselect.c
+++ b/libass/ass_fontselect.c
@@ -636,6 +636,9 @@ char *ass_font_select(ASS_FontSelector *priv, ASS_Library *library,
}
if (!res && default_provider && default_provider->funcs.get_fallback) {
+ char *search_family = family;
+ if (!search_family || !*search_family)
+ search_family = "Arial";
char *fallback_family = default_provider->funcs.get_fallback(
default_provider->priv, family, code);
diff --git a/libass/ass_fontselect.h b/libass/ass_fontselect.h
index db8133a..c989e1a 100644
--- a/libass/ass_fontselect.h
+++ b/libass/ass_fontselect.h
@@ -123,7 +123,7 @@ typedef void (*SubstituteFontFunc)(void *priv, const char *name,
* fallbacks.
*
* \param priv font provider private data
- * \param family original font family name (try matching a similar font)
+ * \param family original font family name (try matching a similar font) (never NULL)
* \param codepoint Unicode codepoint (UTF-32)
* \return output font family, allocated with malloc(), must be freed
* by caller.