]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/avcodec: Free frame_thread_encoder on avcodec_open2() error
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 18 Apr 2021 04:21:50 +0000 (06:21 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 27 Apr 2021 23:50:40 +0000 (01:50 +0200)
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>
libavcodec/avcodec.c

index a3858213759ab2bc5c6972517e4d15cbb64d2ec7..c4083919bb9403cff23ebe1a7705e966c9934fd0 100644 (file)
@@ -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);