diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-13 22:05:25 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-15 19:25:26 +0200 |
commit | 3c2128df7ffdb32a3ef34044f9a4c2f15dc1776f (patch) | |
tree | 87ec8e9593efbcd86e4c00a6cae76a29bad4e91c /libavcodec/avrndec.c | |
parent | d8e4d26de6a96ffd7813aad5bb0680b494192031 (diff) | |
download | ffmpeg-3c2128df7ffdb32a3ef34044f9a4c2f15dc1776f.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>
Diffstat (limited to 'libavcodec/avrndec.c')
-rw-r--r-- | libavcodec/avrndec.c | 2 |
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, }; |