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.rheinha...@outlook.com>
---
 libavcodec/avcodec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 24f6922d4f..6cff596f6a 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -399,6 +399,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);
 
-- 
2.27.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to