Commit b50e987e authored by Rémi Duraffort's avatar Rémi Duraffort

Correctly fix the segfault if no mask is provided.

parent a3fee044
...@@ -168,6 +168,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -168,6 +168,7 @@ static int Create( vlc_object_t *p_this )
p_sys->p_mask = NULL; p_sys->p_mask = NULL;
LoadMask( p_filter, psz_filename ); LoadMask( p_filter, psz_filename );
free( psz_filename ); free( psz_filename );
p_sys->i_x = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "x" ); p_sys->i_x = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "x" );
p_sys->i_y = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "y" ); p_sys->i_y = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "y" );
...@@ -207,24 +208,19 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) ...@@ -207,24 +208,19 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
if( !p_pic ) return NULL; if( !p_pic ) return NULL;
/* If the mask if empty return the picture */
vlc_mutex_lock( &p_sys->lock );
if( !p_sys->p_mask )
{
vlc_mutex_unlock( &p_sys->lock );
return p_pic;
}
p_outpic = filter_NewPicture( p_filter ); p_outpic = filter_NewPicture( p_filter );
if( !p_outpic ) if( !p_outpic )
{ {
picture_Release( p_pic ); picture_Release( p_pic );
vlc_mutex_unlock( &p_sys->lock );
return NULL; return NULL;
} }
/* Here */ /* If the mask is empty: just copy the image */
FilterErase( p_filter, p_pic, p_outpic ); vlc_mutex_lock( &p_sys->lock );
if( p_sys->p_mask )
FilterErase( p_filter, p_pic, p_outpic );
else
picture_CopyPixels( p_outpic, p_pic );
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
return CopyInfoAndRelease( p_outpic, p_pic ); return CopyInfoAndRelease( p_outpic, p_pic );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment