From c5668729be880899ec0cf8faf60edd5dd4ee8d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 28 Dec 2024 16:42:15 +0100 Subject: [PATCH] sub/lavc_conv: free avctx correctly on error Fixes memory leak on error. --- sub/lavc_conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index ead5ec2457..eab8762df1 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -107,7 +107,7 @@ struct lavc_conv *lavc_conv_create(struct sd *sd) error: MP_FATAL(priv, "Could not open libavcodec subtitle converter\n"); av_dict_free(&opts); - av_free(avctx); + avcodec_free_context(&avctx); mp_free_av_packet(&priv->avpkt); mp_free_av_packet(&priv->avpkt_vtt); talloc_free(priv);