From 85fd0c6cfc0137202e28852982f8e5a49df22ebd Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Wed, 3 Feb 2016 23:51:39 +0100 Subject: [PATCH] filter: canvas: add some error handling --- modules/video_filter/canvas.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/video_filter/canvas.c b/modules/video_filter/canvas.c index 91607258b6..f4b797078d 100644 --- a/modules/video_filter/canvas.c +++ b/modules/video_filter/canvas.c @@ -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 );