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

Steven Zhou git at videolan.org
Thu Feb 6 23:11:02 EET 2025


ffmpeg | branch: release/7.1 | Steven Zhou <steven.zhou at netint.ca> | Sat Nov 23 01:20:36 2024 +0000| [57a53adf2b1237965ce6f5546398b1a81599be38] | 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>
(cherry picked from commit d1fa9cf4b496361ebae3c950153756c6f0baf501)

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

 libavfilter/vf_drawtext.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 4c55a01155..daaa1fd83a 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1217,6 +1217,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