From 14473afaa2ff66236dc93212f102eec867deeb37 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Aug 2015 18:34:36 +0200 Subject: 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. --- libass/ass_render_api.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libass') 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, -- cgit v1.2.3