]> git.sesse.net Git - mlt/commitdiff
Fix segfault in SDL observed in Kdenlive.
authorDan Dennedy <dan@dennedy.org>
Mon, 30 Aug 2010 06:41:16 +0000 (23:41 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 30 Aug 2010 06:41:16 +0000 (23:41 -0700)
Triggered by reloading a clip.

src/modules/sdl/consumer_sdl_still.c

index 1ee56941dc1e224c87e5a9b88e2289eb6f369311..95cceaed0929c6f34b26fb52eb30e84c492af69c 100644 (file)
@@ -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 &&