summaryrefslogtreecommitdiff
path: root/libavcodec/gif.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-14 17:30:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 19:25:26 +0200
commit8da8774d8eb1d5dec830f36d2e6b0ace1b16e2f5 (patch)
tree2405485e042cd4b28d2131a00f9e72e296f7ed16 /libavcodec/gif.c
parent39638ace670afd95b7094471a41f71af8c0cad33 (diff)
avcodec/gif: Fix leaks upon allocation error
If one of several allocations the gif encoder performs in its init function fails, the successful allocations leak. Fix this by adding the FF_CODEC_CAP_INIT_CLEANUP flag. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/gif.c')
-rw-r--r--libavcodec/gif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 65a76cfde4..de41992851 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -497,4 +497,5 @@ AVCodec ff_gif_encoder = {
AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE
},
.priv_class = &gif_class,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};