Commit 7885fa76 authored by Michael Niedermayer's avatar Michael Niedermayer

ff_lock_avcodec: make the lock state be consistent in case of failure.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2dec950f
......@@ -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);
......
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