]> granicus.if.org Git - libass/commitdiff
Destroy harfbuzz faces before freetype faces
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 29 Dec 2014 00:34:47 +0000 (16:34 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 29 Dec 2014 00:34:47 +0000 (16:34 -0800)
HarfBuzz faces reference the FreeType faces.  Destroying FT faces first can cause crash in HB destruction code:

  https://bugs.freedesktop.org/show_bug.cgi?id=86300

libass/ass_font.c

index 7b202a60527007f4e8b1eaebab51216eee6e275e..3633eb5b3d6288f60ad2dfb052279be4f0ae2b86 100644 (file)
@@ -685,11 +685,11 @@ FT_Vector ass_font_get_kerning(ASS_Font *font, uint32_t c1, uint32_t c2)
 void ass_font_free(ASS_Font *font)
 {
     int i;
+    if (font->shaper_priv)
+        ass_shaper_font_data_free(font->shaper_priv);
     for (i = 0; i < font->n_faces; ++i)
         if (font->faces[i])
             FT_Done_Face(font->faces[i]);
-    if (font->shaper_priv)
-        ass_shaper_font_data_free(font->shaper_priv);
     free(font->desc.family);
     free(font);
 }