This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/5.1
in repository ffmpeg.

commit 5f1253b5714f9880937cd91933666829211e9107
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sun May 17 13:49:39 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sat Jun 13 18:38:04 2026 +0200

    avfilter/vf_drawtext: avoid double-free of aliased FT_Glyph in 
glyph_enu_free
    
    For glyphs whose source is already in bitmap form (color emoji fonts such
    as NotoColorEmoji.ttf), FT_Glyph_To_Bitmap(..., destroy=0) returns the
    input pointer unchanged. The result is that glyph->bglyph[idx] aliases
    glyph->glyph (and analogously border_bglyph[t] may alias border_glyph).
    glyph_enu_free then called FT_Done_Glyph on both, double-freeing the
    underlying object.
    
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 9efca1d94634c36499ca6e9ff37bddc94a61d605)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_drawtext.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index e85f5c03f2..0fcb7ac5d2 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -829,8 +829,9 @@ static int glyph_enu_free(void *opaque, void *elem)
 {
     Glyph *glyph = elem;
 
+    if (glyph->border_glyph && glyph->border_glyph != glyph->glyph)
+        FT_Done_Glyph(glyph->border_glyph);
     FT_Done_Glyph(glyph->glyph);
-    FT_Done_Glyph(glyph->border_glyph);
     av_free(elem);
     return 0;
 }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to