summaryrefslogtreecommitdiff
path: root/libavcodec/avrndec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 22:05:25 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 19:25:26 +0200
commit3c2128df7ffdb32a3ef34044f9a4c2f15dc1776f (patch)
tree87ec8e9593efbcd86e4c00a6cae76a29bad4e91c /libavcodec/avrndec.c
parentd8e4d26de6a96ffd7813aad5bb0680b494192031 (diff)
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>
Diffstat (limited to 'libavcodec/avrndec.c')
-rw-r--r--libavcodec/avrndec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index a4b6fadfc8..c5a60acd4f 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -170,5 +170,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,
};