summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-28 18:34:36 +0200
committerwm4 <wm4@nowhere>2015-08-28 18:34:36 +0200
commit14473afaa2ff66236dc93212f102eec867deeb37 (patch)
treedf6f0a080335ec76d7a7b6eefa92a48ae29c1a8f /libass
parent102e28d6b7fc54b71fe223f4acf7cbdd373b5c02 (diff)
downloadlibass-14473afaa2ff66236dc93212f102eec867deeb37.tar.bz2
libass-14473afaa2ff66236dc93212f102eec867deeb37.tar.xz
render_api: fix crash when calling ass_set_fonts() after rendering
The caches may reference data which belongs to the font provider. If the font selector and the font provider are destroyed, it can leave dangling pointers in the renderer cache. (At least that's what it looks like.) For some reason, this didn't even trigger valgrind warnings with the fontconfig font provider. Possibly the dangling pointers were FT_Face pointers, and fontconfig might cache these process-wide.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libass/ass_render_api.c b/libass/ass_render_api.c
index a23cd20..975cd63 100644
--- a/libass/ass_render_api.c
+++ b/libass/ass_render_api.c
@@ -144,6 +144,8 @@ void ass_set_fonts(ASS_Renderer *priv, const char *default_font,
priv->settings.default_family =
default_family ? strdup(default_family) : 0;
+ ass_reconfigure(priv);
+
if (priv->fontselect)
ass_fontselect_free(priv->fontselect);
priv->fontselect = ass_fontselect_init(priv->library, priv->ftlibrary,