From 2051b401cc7e9ec9051c7f575d639944a9869b67 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Fri, 10 Apr 2015 17:28:45 +0300 Subject: [PATCH] avfilter/drawtext: fix frame mem leak Signed-off-by: Ivan Efimov Signed-off-by: Michael Niedermayer --- libavfilter/vf_drawtext.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 37eb231524..cf17a552f0 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1275,12 +1275,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) int ret; if (s->reload) { - if ((ret = load_textfile(ctx)) < 0) + if ((ret = load_textfile(ctx)) < 0) { + av_frame_free(&frame); return ret; + } #if CONFIG_LIBFRIBIDI if (s->text_shaping) - if ((ret = shape_text(ctx)) < 0) + if ((ret = shape_text(ctx)) < 0) { + av_frame_free(&frame); return ret; + } #endif }