]>
git.sesse.net Git - mlt/commit
sdl/consumer_sdl_still.c: use mutex when changing sdl_screen
Fixes Coverity CID 709357: Data race condition (MISSING_LOCK)
Accessing variable "this->sdl_screen" (consumer_sdl_s.sdl_screen) requires the mlt_sdl_mutex lock.
230 this->sdl_screen = NULL;
...
Locking "mlt_sdl_mutex".
445 pthread_mutex_lock( &mlt_sdl_mutex );
consumer_sdl_s.sdl_screen is being accessed with lock "mlt_sdl_mutex" held.
446 this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags );
447 if ( consumer_get_dimensions( &this->window_width, &this->window_height ) )
448 this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags );
449
450 uint32_t color = mlt_properties_get_int( this->properties, "window_background" );
451 if ( this->sdl_screen )
452 {
453 SDL_FillRect( this->sdl_screen, NULL, color >> 8 );
454 changed = 1;
455 }
456 pthread_mutex_unlock( &mlt_sdl_mutex );