From a489b6a8e398614d8f719b318bbb02db3da4510d Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 14 Sep 2020 01:37:07 +0200 Subject: [PATCH] avcodec/cfhdenc: Fix leaks on allocation errors 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 Signed-off-by: Andreas Rheinhardt --- 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, };