Originally, i got "Can't draw text" errors.
Obviously, function fail was triggered by check of 'ret', which is not
init'ed in case av_tree_find() returned not NULL.
---8<---
---
 libavfilter/vf_drawtext.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index dcde542..760981b 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -493,8 +493,10 @@ static int dtext_prepare_text(AVFilterContext *ctx)
         dummy.code = code;
         glyph = av_tree_find(dtext->glyphs, &dummy, glyph_cmp, NULL);
         if (!glyph)
+        {
             ret = load_glyph(ctx, &glyph, code);
-        if (ret) return ret;
+            if (ret) return ret;
+        }

         y_min = FFMIN(glyph->bbox.yMin, y_min);
         y_max = FFMAX(glyph->bbox.yMax, y_max);
-- 
1.7.7

-- 
Andrey Utkin
From 026585566de50fe7e59fb4562d6c6ed89086c3be Mon Sep 17 00:00:00 2001
From: Andrey Utkin <[email protected]>
Date: Fri, 3 Feb 2012 21:39:52 +0200
Subject: [PATCH] drawtext: Fix if block

---
 libavfilter/vf_drawtext.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index dcde542..760981b 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -493,8 +493,10 @@ static int dtext_prepare_text(AVFilterContext *ctx)
         dummy.code = code;
         glyph = av_tree_find(dtext->glyphs, &dummy, glyph_cmp, NULL);
         if (!glyph)
+        {
             ret = load_glyph(ctx, &glyph, code);
-        if (ret) return ret;
+            if (ret) return ret;
+        }
 
         y_min = FFMIN(glyph->bbox.yMin, y_min);
         y_max = FFMAX(glyph->bbox.yMax, y_max);
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to