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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 63c436242d..303dcfe26e 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -534,10 +534,10 @@ static av_cold void uninit(AVFilterContext *ctx)
{
DrawTextContext *s = ctx->priv;
- av_expr_free(s->x_pexpr); s->x_pexpr = NULL;
- av_expr_free(s->y_pexpr); s->y_pexpr = NULL;
- av_expr_free(s->draw_pexpr); s->draw_pexpr = NULL;
-
+ av_expr_free(s->x_pexpr);
+ av_expr_free(s->y_pexpr);
+ av_expr_free(s->draw_pexpr);
+ s->x_pexpr = s->y_pexpr = s->draw_pexpr = NULL;
av_freep(&s->positions);
s->nb_positions = 0;
@@ -580,6 +580,10 @@ static int config_input(AVFilterLink *inlink)
av_lfg_init(&s->prng, av_get_random_seed());
+ av_expr_free(s->x_pexpr);
+ av_expr_free(s->y_pexpr);
+ av_expr_free(s->draw_pexpr);
+ s->x_pexpr = s->y_pexpr = s->draw_pexpr = NULL;
if ((ret = av_expr_parse(&s->x_pexpr, s->x_expr, var_names,
NULL, NULL, fun2_names, fun2, 0, ctx)) < 0 ||
(ret = av_expr_parse(&s->y_pexpr, s->y_expr, var_names,