]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/indeo5: Fix memleaks upon allocation error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 14 Sep 2020 18:59:12 +0000 (20:59 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 17:25:26 +0000 (19:25 +0200)
ff_ivi_init_planes() might error out after having allocated some arrays.
Set the FF_CODEC_CAP_INIT_CLEANUP flag in order to free these arrays in
this case.

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

index 4ccdbcaf0abd2a12cf7cbd8c1d25cd2965d728ef..ac15d31fef59c2c11002b40ca06c59c6fe2f35d6 100644 (file)
@@ -30,6 +30,7 @@
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "get_bits.h"
+#include "internal.h"
 #include "ivi.h"
 #include "ivi_dsp.h"
 #include "indeo5data.h"
@@ -692,4 +693,5 @@ AVCodec ff_indeo5_decoder = {
     .close          = ff_ivi_decode_close,
     .decode         = ff_ivi_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };