aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/avcodec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-18 06:21:50 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-28 01:50:40 +0200
commitd07534b5f5f20b4f780f5b0284aca6354da00695 (patch)
treead6bacd9f7442198dab1af1a1962a7c65afab707 /libavcodec/avcodec.c
parent83b6471dcb762859f20b2c414decc755fcceb5e8 (diff)
downloadffmpeg-d07534b5f5f20b4f780f5b0284aca6354da00695.tar.gz
avcodec/avcodec: Free frame_thread_encoder on avcodec_open2() error
The frame_thread_encoder has so far not been freed in case an error happened in avcodec_open2() after ff_frame_thread_encoder_init(). This commit changes this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r--libavcodec/avcodec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index a385821375..c4083919bb 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -383,6 +383,8 @@ free_and_end:
avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
avctx->codec->close(avctx);
+ if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder)
+ ff_frame_thread_encoder_free(avctx);
if (HAVE_THREADS && avci->thread_ctx)
ff_thread_free(avctx);