diff mbox series

[FFmpeg-devel,38/40] avcodec/ffv1enc: Fix memleaks on init failure

Message ID 20200914052747.124118-22-andreas.rheinhardt@gmail.com
State Accepted
Commit f9215d0bb20242299f3654fd4646511665b20c4c
Headers show
Series [FFmpeg-devel,01/16] avcodec/snowdec: Use ff_snow_common_init() directly | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 14, 2020, 5:27 a.m. UTC
The FFV1 encoder has so far not cleaned up after itself in this case;
but it can be done easily by setting the FF_CODEC_CAP_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/ffv1enc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Sept. 16, 2020, 6:25 p.m. UTC | #1
On Mon, Sep 14, 2020 at 07:27:45AM +0200, Andreas Rheinhardt wrote:
> The FFV1 encoder has so far not cleaned up after itself in this case;
> but it can be done easily by setting the FF_CODEC_CAP_INIT_CLEANUP flag.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/ffv1enc.c | 1 +
>  1 file changed, 1 insertion(+)

probably ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 97dc15eac9..611b250e96 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1354,4 +1354,5 @@  AVCodec ff_ffv1_encoder = {
     .defaults       = ffv1_defaults,
 #endif
     .priv_class     = &ffv1_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };