]>
git.sesse.net Git - mlt/commit
sdl/consumer_sdl_preview.c: use mutex when changing refresh_count
Fixes Coverity CID 709360: Data race condition (MISSING_LOCK)
Locking "this->refresh_mutex".
133 pthread_mutex_lock( &this->refresh_mutex );
consumer_sdl_s.refresh_count is being accessed with lock "this->refresh_mutex" held.
134 this->refresh_count = this->refresh_count <= 0 ? 1 : this->refresh_count + 1;
135 pthread_cond_broadcast( &this->refresh_cond );
136 pthread_mutex_unlock( &this->refresh_mutex );
...
Accessing variable "this->refresh_count" (consumer_sdl_s.refresh_count) requires the consumer_sdl_s.refresh_mutex lock.
295 this->refresh_count = 0;
...
Locking "this->refresh_mutex".
445 pthread_mutex_lock( &this->refresh_mutex );
446 if ( this->running && speed == 0 && this->refresh_count <= 0 )
447 {
448 mlt_events_fire( properties, "consumer-sdl-paused", NULL );
449 pthread_cond_wait( &this->refresh_cond, &this->refresh_mutex );
450 }
consumer_sdl_s.refresh_count is being accessed with lock "this->refresh_mutex" held.
451 this->refresh_count --;
452 pthread_mutex_unlock( &this->refresh_mutex );