diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-18 22:13:35 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-05-17 07:44:04 +0200 |
commit | 3fb29588a27a711132106b924e27b53789a58dcb (patch) | |
tree | 8f17de6547dc5524a2ff42c43b5a45091b414026 | |
parent | 6592cd22a2307dbbeb621c7499ba81961e6face8 (diff) | |
download | ffmpeg-3fb29588a27a711132106b924e27b53789a58dcb.tar.gz |
vf_drawtext: don't leak the expressions.
-rw-r--r-- | libavfilter/vf_drawtext.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 2989bd5034..53340c84ab 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -402,6 +402,10 @@ static av_cold void uninit(AVFilterContext *ctx) DrawTextContext *s = ctx->priv; int i; + av_expr_free(s->x_pexpr); + av_expr_free(s->y_pexpr); + av_expr_free(s->d_pexpr); + s->x_pexpr = s->y_pexpr = s->d_pexpr = NULL; av_freep(&s->expanded_text); av_freep(&s->positions); av_tree_enumerate(s->glyphs, NULL, NULL, glyph_enu_free); @@ -573,6 +577,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->d_pexpr); + s->x_pexpr = s->y_pexpr = s->d_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, |