]> granicus.if.org Git - libass/commitdiff
renderer: fix potential memory leak
authorDr.Smile <vabnick@gmail.com>
Sun, 2 Dec 2018 20:37:12 +0000 (23:37 +0300)
committerDr.Smile <vabnick@gmail.com>
Sun, 19 May 2019 17:25:09 +0000 (20:25 +0300)
libass/ass_render.c

index dbfa00b405766eb5678875f061a430452e5e7d60..8e5014e423203006d1921bda1d210a0fa0fd91a8 100644 (file)
@@ -1187,8 +1187,10 @@ transform_3d(ASS_Vector shift, ASS_Outline *outline, int n_outlines,
 static void
 get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info)
 {
-    if (!info->outline || info->symbol == '\n' || info->symbol == 0 || info->skip)
+    if (!info->outline || info->symbol == '\n' || info->symbol == 0 || info->skip) {
+        ass_cache_dec_ref(info->hash_key.u.outline.outline);
         return;
+    }
 
     BitmapHashValue *val = ass_cache_get(render_priv->cache.bitmap_cache, &info->hash_key, render_priv);
     if (!val || !val->valid)