avcodec/mpeg12enc: Add FF_CODEC_CAP_INIT_CLEANUP
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 27 Aug 2019 15:21:00 +0000 (17:21 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 11 Sep 2019 20:43:14 +0000 (22:43 +0200)
Fixes: Multiple memleaks
Fixes: ffmpeg-memory-leak

Found-by: Francis Provencher <francis@protekresearchlab.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpeg12enc.c

index 2bc5289..cbf2f6f 100644 (file)
@@ -1193,6 +1193,7 @@ AVCodec ff_mpeg1video_encoder = {
     .pix_fmts             = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
                                                            AV_PIX_FMT_NONE },
     .capabilities         = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
+    .caps_internal        = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_class           = &mpeg1_class,
 };
 
@@ -1210,5 +1211,6 @@ AVCodec ff_mpeg2video_encoder = {
                                                            AV_PIX_FMT_YUV422P,
                                                            AV_PIX_FMT_NONE },
     .capabilities         = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
+    .caps_internal        = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_class           = &mpeg2_class,
 };