mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
libavcodec/utils: Free threads on init failure
Fixes: Multiple memleaks Fixes: ffmpeg-memory-leak Found-by: Francis Provencher <francis@protekresearchlab.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9fd62b84d5
commit
61b055bed0
@ -1029,6 +1029,9 @@ free_and_end:
|
|||||||
(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
|
(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
|
||||||
avctx->codec->close(avctx);
|
avctx->codec->close(avctx);
|
||||||
|
|
||||||
|
if (HAVE_THREADS && avctx->internal->thread_ctx)
|
||||||
|
ff_thread_free(avctx);
|
||||||
|
|
||||||
if (codec->priv_class && codec->priv_data_size)
|
if (codec->priv_class && codec->priv_data_size)
|
||||||
av_opt_free(avctx->priv_data);
|
av_opt_free(avctx->priv_data);
|
||||||
av_opt_free(avctx);
|
av_opt_free(avctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user