[FFmpeg-cvslog] avcodec/flacenc: Fix memleak upon init error

Andreas Rheinhardt git at videolan.org
Fri Apr 2 20:48:42 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Nov 29 22:28:37 2020 +0100| [56bd071e5487fcf516d942bbc84d7a77b0bdf9b6] | committer: Andreas Rheinhardt

avcodec/flacenc: Fix memleak upon init error

An AVMD5 struct would leak if an error happened after its allocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavcodec/flacenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 34fcd95795..05a85d830f 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -1513,4 +1513,5 @@ AVCodec ff_flac_encoder = {
                                                      AV_SAMPLE_FMT_S32,
                                                      AV_SAMPLE_FMT_NONE },
     .priv_class     = &flac_encoder_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };



More information about the ffmpeg-cvslog mailing list