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:
authorClément Bœsch <cboesch@gopro.com>2017-01-11 19:10:07 +0300
committerClément Bœsch <cboesch@gopro.com>2017-01-16 12:43:41 +0300
commita91c265f393b72925dc440f79b3ec4ec7aba575f (patch)
tree58b24d5fa66c0b62536eb5bba1491a12aaad674e /libavcodec/pthread_frame.c
parent591be9e38443a01cea88db787be8a5c9a66c43a2 (diff)
lavc/pthread_frame: protect read state access in setup finish function
Diffstat (limited to 'libavcodec/pthread_frame.c')
-rw-r--r--libavcodec/pthread_frame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 7ef5e9f6be..cb6d76284e 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -509,11 +509,11 @@ void ff_thread_finish_setup(AVCodecContext *avctx) {
if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return;
+ pthread_mutex_lock(&p->progress_mutex);
if(p->state == STATE_SETUP_FINISHED){
av_log(avctx, AV_LOG_WARNING, "Multiple ff_thread_finish_setup() calls\n");
}
- pthread_mutex_lock(&p->progress_mutex);
p->state = STATE_SETUP_FINISHED;
pthread_cond_broadcast(&p->progress_cond);
pthread_mutex_unlock(&p->progress_mutex);