[FFmpeg-devel] [PATCH 29/40] avcodec/cfhdenc: Fix leaks on allocation errors

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Sep 14 08:27:36 EEST 2020


The CineForm HD encoder attempts to allocate several buffers in its init
function; yet if only some of these allocations succeed, the
successfully allocated buffers leak. This is fixed by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/cfhdenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 776b6da235..5554baefa3 100644
--- a/libavcodec/cfhdenc.c
+++ b/libavcodec/cfhdenc.c
@@ -919,4 +919,5 @@ AVCodec ff_cfhd_encoder = {
                           AV_PIX_FMT_GBRAP12,
                           AV_PIX_FMT_NONE
                         },
+    .caps_internal    = FF_CODEC_CAP_INIT_CLEANUP,
 };
-- 
2.25.1



More information about the ffmpeg-devel mailing list