]> granicus.if.org Git - libass/commitdiff
Fix drawing parser memory leak
authorGrigori Goronzy <greg@blackbox>
Sun, 19 Jul 2009 06:39:24 +0000 (08:39 +0200)
committerGrigori Goronzy <greg@blackbox>
Sun, 19 Jul 2009 13:56:24 +0000 (15:56 +0200)
Always free the drawing glyph in ass_drawing_free; do not double free
clip vector bitmap.

libass/ass_drawing.c
libass/ass_render.c

index 091ec879b40b6ce4f382147f2827b7e848bc60d7..0b270c1a170c9f34f893751d93cb1184ee350829 100644 (file)
@@ -384,6 +384,7 @@ ass_drawing_t *ass_drawing_new(void *fontconfig_priv, ass_font_t *font,
  */
 void ass_drawing_free(ass_drawing_t* drawing)
 {
+    FT_Done_Glyph((FT_Glyph) drawing->glyph);
     free(drawing->text);
     free(drawing);
 }
@@ -481,5 +482,3 @@ FT_OutlineGlyph *ass_drawing_parse(ass_drawing_t *drawing, int raw_mode)
     drawing_free_tokens(drawing->tokens);
     return &drawing->glyph;
 }
-
-
index aeeb0acb7f3adf8e0e94141e33bd58153332ca16..b045a75fb6eba0032b611b99f2aded7acf188bb5 100644 (file)
@@ -817,7 +817,6 @@ static void blend_vector_clip(ass_renderer_t *render_priv,
     }
 
     // Free clip vector and its bitmap, we don't need it anymore
-    FT_Done_Glyph((FT_Glyph) drawing->glyph);
     FT_Done_Glyph(glyph);
     ass_drawing_free(render_priv->state.clip_drawing);
     render_priv->state.clip_drawing = 0;