Commit 61b055be authored by Michael Niedermayer's avatar Michael Niedermayer

libavcodec/utils: Free threads on init failure

Fixes: Multiple memleaks
Fixes: ffmpeg-memory-leak
Found-by: 's avatarFrancis Provencher <francis@protekresearchlab.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9fd62b84
......@@ -1029,6 +1029,9 @@ free_and_end:
(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
avctx->codec->close(avctx);
if (HAVE_THREADS && avctx->internal->thread_ctx)
ff_thread_free(avctx);
if (codec->priv_class && codec->priv_data_size)
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment