]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mobiclip: Fix memleak upon init failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 00:44:36 +0000 (02:44 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 17:25:26 +0000 (19:25 +0200)
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>
libavcodec/mobiclip.c

index 25a7f0ed14b13f21d4d9113ce7da9e0fc9643800..8758e7f617922a924cc4054ad3a9a9da340bd7be 100644 (file)
@@ -1436,4 +1436,5 @@ AVCodec ff_mobiclip_decoder = {
     .flush          = mobiclip_flush,
     .close          = mobiclip_close,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };