avfilter/vf_drawtext: Check return code of load_glyph()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 24 Apr 2016 10:30:20 +0000 (12:30 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 24 Apr 2016 10:39:25 +0000 (12:39 +0200)
Fixes segfault
Fixes Ticket5347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_drawtext.c

index 6b9af5b..214aef0 100644 (file)
@@ -1224,7 +1224,9 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
         dummy.code = code;
         glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL);
         if (!glyph) {
-            load_glyph(ctx, &glyph, code);
+            ret = load_glyph(ctx, &glyph, code);
+            if (ret < 0)
+                return ret;
         }
 
         y_min = FFMIN(glyph->bbox.yMin, y_min);