aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/magicyuvenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 02:13:56 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:57 +0100
commitd0045b41a362c1724a0e0659d32b664becd4c2d8 (patch)
treec75857219a232e26187e67ded509a9160a164c7b /libavcodec/magicyuvenc.c
parent9ce88b5b5361c019a1db0c6993fc25f5e316a204 (diff)
downloadffmpeg-d0045b41a362c1724a0e0659d32b664becd4c2d8.tar.gz
avcodec/magicyuvenc: Fix memleak upon init failure
If an error happens during init after an allocation has succeeded, the already allocated data leaked up until now. Fix this 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> (cherry picked from commit a8ebb5632018adad733f89fa4efe74d7e92155ac)
Diffstat (limited to 'libavcodec/magicyuvenc.c')
-rw-r--r--libavcodec/magicyuvenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index e9fe3bf519..0bd6b8ef6a 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -587,4 +587,5 @@ AVCodec ff_magicyuv_encoder = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
},
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};