From d1fa9cf4b496361ebae3c950153756c6f0baf501 Mon Sep 17 00:00:00 2001 From: Steven Zhou Date: Sat, 23 Nov 2024 01:20:36 +0000 Subject: [PATCH] avfilter/drawtext: fix memory leak when using "reinit" runtime command Free AVOption in drawtext private context when freeing old copy of drawtext private context during processing of "reinit" runtime command. Signed-off-by: Steven Zhou Signed-off-by: James Almer --- libavfilter/vf_drawtext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 40e0e9a7ef..e4662f3a45 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1226,6 +1226,7 @@ static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char ctx->priv = old; uninit(ctx); + av_opt_free(old); av_freep(&old); ctx->priv = new;