From eb884ab888d9f3b0ad831e4b6e2f2fc3bf5738f2 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sun, 29 Aug 2010 23:41:16 -0700 Subject: [PATCH] Fix segfault in SDL observed in Kdenlive. Triggered by reloading a clip. --- src/modules/sdl/consumer_sdl_still.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 1ee56941..95cceaed 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -440,11 +440,14 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags ); if ( consumer_get_dimensions( &this->window_width, &this->window_height ) ) this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags ); - pthread_mutex_unlock( &mlt_sdl_mutex ); uint32_t color = mlt_properties_get_int( this->properties, "window_background" ); - SDL_FillRect( this->sdl_screen, NULL, color >> 8 ); - changed = 1; + if ( this->sdl_screen ) + { + SDL_FillRect( this->sdl_screen, NULL, color >> 8 ); + changed = 1; + } + pthread_mutex_unlock( &mlt_sdl_mutex ); } if ( changed == 0 && -- 2.39.2