[FFmpeg-cvslog] avcodec/ffv1enc: Fix memleaks on init failure

Andreas Rheinhardt git at videolan.org
Thu Sep 17 01:10:16 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Sep 14 05:30:15 2020 +0200| [f9215d0bb20242299f3654fd4646511665b20c4c] | committer: Andreas Rheinhardt

avcodec/ffv1enc: Fix memleaks on init failure

The FFV1 encoder has so far not cleaned up after itself in this case;
but it can be done easily by setting the FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

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

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 97dc15eac9..611b250e96 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1354,4 +1354,5 @@ AVCodec ff_ffv1_encoder = {
     .defaults       = ffv1_defaults,
 #endif
     .priv_class     = &ffv1_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };



More information about the ffmpeg-cvslog mailing list