Commit 85fd0c6c authored by Tristan Matthews's avatar Tristan Matthews

filter: canvas: add some error handling

parent 4522fbf6
......@@ -329,10 +329,24 @@ static int Activate( vlc_object_t *p_this )
filter_chain_Reset( p_sys->p_chain, &p_filter->fmt_in, &fmt );
/* Append scaling module */
filter_chain_AppendFilter( p_sys->p_chain, NULL, NULL, NULL, NULL );
if ( !filter_chain_AppendFilter( p_sys->p_chain, NULL, NULL, NULL, NULL ) )
{
msg_Err( p_filter, "Could not append scaling filter" );
free( p_sys );
return VLC_EGENERIC;
}
/* Append croppadd module if we actually do cropping or padding instead of just scaling*/
if( i_padd > 0 )
filter_chain_AppendFromString( p_sys->p_chain, psz_croppadd );
{
if ( !filter_chain_AppendFromString( p_sys->p_chain, psz_croppadd ) )
{
msg_Err( p_filter, "Could not append cropadd filter" );
filter_chain_Delete( p_sys->p_chain );
free( p_sys );
return VLC_EGENERIC;
}
}
fmt = *filter_chain_GetFmtOut( p_sys->p_chain );
es_format_Copy( &p_filter->fmt_out, &fmt );
......
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