]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cfhdenc: Fix leaks on allocation errors
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 13 Sep 2020 23:37:07 +0000 (01:37 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 14 Sep 2020 13:11:27 +0000 (15:11 +0200)
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.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/cfhdenc.c

index 776b6da2358ea1ce76099e30a0146155a07d26af..5554baefa3fd4f379fbaab097340d9af45e563e8 100644 (file)
@@ -919,4 +919,5 @@ AVCodec ff_cfhd_encoder = {
                           AV_PIX_FMT_GBRAP12,
                           AV_PIX_FMT_NONE
                         },
+    .caps_internal    = FF_CODEC_CAP_INIT_CLEANUP,
 };