[FFmpeg-cvslog] avfilter/drawtext: fix memory leak when using "reinit" runtime command

Steven Zhou git at videolan.org
Thu Feb 6 22:41:45 EET 2025


ffmpeg | branch: master | Steven Zhou <steven.zhou at netint.ca> | Sat Nov 23 01:20:36 2024 +0000| [d1fa9cf4b496361ebae3c950153756c6f0baf501] | committer: James Almer

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 <steven.zhou at netint.ca>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1fa9cf4b496361ebae3c950153756c6f0baf501
---

 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;



More information about the ffmpeg-cvslog mailing list