summaryrefslogtreecommitdiff
path: root/libavfilter/vf_drawtext.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_drawtext.c')
-rw-r--r--libavfilter/vf_drawtext.c8
1 files 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
}