From: Rafaël Carré Date: Fri, 12 Oct 2007 18:32:39 +0000 (+0000) Subject: logo filter: fail early if the logo hasn't been specified (rather than segfaulting) X-Git-Tag: 0.9.0-test0~5064 X-Git-Url: http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=4714362c3b9009f46270352701719413319d57ab logo filter: fail early if the logo hasn't been specified (rather than segfaulting) --- diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c index 8147d16380..c3a3688c8b 100644 --- a/modules/video_filter/logo.c +++ b/modules/video_filter/logo.c @@ -322,13 +322,6 @@ static int Create( vlc_object_t *p_this ) return VLC_ENOMEM; } - p_vout->pf_init = Init; - p_vout->pf_end = End; - p_vout->pf_manage = NULL; - p_vout->pf_render = Render; - p_vout->pf_display = NULL; - p_vout->pf_control = Control; - config_ChainParse( p_vout, CFG_PREFIX, ppsz_filter_options, p_vout->p_cfg ); @@ -337,9 +330,16 @@ static int Create( vlc_object_t *p_this ) if( !p_logo_list->psz_filename || !*p_logo_list->psz_filename ) { msg_Err( p_vout, "logo file not specified" ); - return 0; + return VLC_EGENERIC; } + p_vout->pf_init = Init; + p_vout->pf_end = End; + p_vout->pf_manage = NULL; + p_vout->pf_render = Render; + p_vout->pf_display = NULL; + p_vout->pf_control = Control; + p_sys->pos = var_CreateGetIntegerCommand( p_vout, "logo-position" ); p_sys->posx = var_CreateGetIntegerCommand( p_vout, "logo-x" ); p_sys->posy = var_CreateGetIntegerCommand( p_vout, "logo-y" );