Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-27 18:21:00 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-16 01:04:18 +0300
commit61b055bed0968d60eb24a5080fb4ba2bcf73b753 (patch)
tree5f1ab733d9c1a8dcc6e9ac36271ae74589734849 /libavcodec
parent9fd62b84d57e2fa676f90eb843c2ecb1130427d5 (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a6a646636d..729c10a8ed 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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);