avfilter/vf_drawtext: Check return code of load_glyph()

Fixes segfault
Fixes Ticket5347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2e67a99fbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-04-24 12:30:20 +02:00
parent 76060ae4e9
commit f2c6a5d0bd
1 changed files with 3 additions and 1 deletions

View File

@ -1210,7 +1210,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);