aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 22:05:25 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:57 +0100
commit9c6d8ae33c1666bbfb8411f2efb3208711486163 (patch)
tree634c5af3a1e10d85af4815c34b80b05b9e5d6df5
parent682574e1da9bd87b32d5d46143fe2b434f742259 (diff)
downloadffmpeg-9c6d8ae33c1666bbfb8411f2efb3208711486163.tar.gz
avcodec/avrndec: Fix memleak on error
If ff_codec_open2_recursive() fails, the already allocated AVCodecContext leaks. 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> (cherry picked from commit 3c2128df7ffdb32a3ef34044f9a4c2f15dc1776f)
-rw-r--r--libavcodec/avrndec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index d10c4395e3..9222e1247a 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -171,5 +171,5 @@ AVCodec ff_avrn_decoder = {
.close = end,
.decode = decode_frame,
.max_lowres = 3,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};