From 669ff26bc283c39334e7df3a81fd0db0088a7442 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 20 Jan 2023 19:20:30 -0600 Subject: [PATCH] avcodec/mfenc: fix double-free on init failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mfenc sets FF_CODEC_CAP_INIT_CLEANUP, so calling mf_close() on failure inside mf_init() results in a double-free. Signed-off-by: Cameron Gutman Signed-off-by: Martin Storsjö --- libavcodec/mfenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index 36a6d8482d..f3415df10b 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -1214,7 +1214,6 @@ static int mf_init(AVCodecContext *avctx) return 0; } } - mf_close(avctx); return ret; }