[FFmpeg-cvslog] avcodec/mfenc: fix double-free on init failure

Cameron Gutman git at videolan.org
Tue Jan 31 15:15:38 EET 2023


ffmpeg | branch: master | Cameron Gutman <aicommander at gmail.com> | Fri Jan 20 19:20:30 2023 -0600| [669ff26bc283c39334e7df3a81fd0db0088a7442] | committer: Martin Storsjö

avcodec/mfenc: fix double-free on init failure

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 <aicommander at gmail.com>
Signed-off-by: Martin Storsjö <martin at martin.st>

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

 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;
 }
 



More information about the ffmpeg-cvslog mailing list