aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-06 02:21:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-06 03:12:34 +0100
commit7885fa7685c0085e42495482e6b79310f8d66dbc (patch)
treef08d6ce0324dbff17b6dffc961c3a30038371e50 /libavcodec/utils.c
parent2dec950f49049b55a4d4147673824dc817cb27e5 (diff)
downloadffmpeg-7885fa7685c0085e42495482e6b79310f8d66dbc.tar.gz
ff_lock_avcodec: make the lock state be consistent in case of failure.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 131c156a6c..d042afa3c9 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2555,6 +2555,8 @@ int ff_lock_avcodec(AVCodecContext *log_ctx)
entangled_thread_counter++;
if (entangled_thread_counter != 1) {
av_log(log_ctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n");
+ ff_avcodec_locked = 1;
+ ff_unlock_avcodec();
return AVERROR(EINVAL);
}
av_assert0(!ff_avcodec_locked);