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

James Almer jamrial at gmail.com
Sat Jan 18 01:35:47 EET 2025


On 11/22/2024 10:20 PM, Steven Zhou wrote:
> 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>
> ---
>   libavfilter/vf_drawtext.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 8de24625d6..038646b112 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;

Will apply.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250117/dc078db4/attachment.sig>


More information about the ffmpeg-devel mailing list