Browse Source

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@netint.ca>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d1fa9cf4b496361ebae3c950153756c6f0baf501)
Steven Zhou 3 months ago
parent
commit
57a53adf2b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      libavfilter/vf_drawtext.c

+ 1 - 0
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;