[vlc-devel] [vlc-commits] Qt: capture panel: fix segfault on null value.

Rémi Denis-Courmont remi at remlab.net
Fri Jan 25 14:15:10 CET 2013


Le vendredi 25 janvier 2013 15:02:23, Francois Cartegnie a écrit :
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 25
> 14:01:32 2013 +0100| [6675dc2e8b763136b83c044bd45dca3df1142bff] |
> committer: Francois Cartegnie
> 
> Qt: capture panel: fix segfault on null value.
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6675dc2e8b763136b8
> > 3c044bd45dca3df1142bff
> 
> ---
> 
>  modules/gui/qt4/components/preferences_widgets.cpp |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/gui/qt4/components/preferences_widgets.cpp
> b/modules/gui/qt4/components/preferences_widgets.cpp index
> ced4394..d54cc6c 100644
> --- a/modules/gui/qt4/components/preferences_widgets.cpp
> +++ b/modules/gui/qt4/components/preferences_widgets.cpp
> @@ -481,7 +481,7 @@ void setfillVLCConfigCombo( const char *configname,
> intf_thread_t *p_intf, for( ssize_t i = 0; i < count; i++ )
>          {
>              combo->addItem( qtr(texts[i]), QVariant(qfu(values[i])) );
> -            if( !strcmp(p_config->value.psz, values[i]) )
> +            if( p_config->value.psz && !strcmp(p_config->value.psz,
> values[i]) ) combo->setCurrentIndex( i );
>              free( texts[i] );
>              free( values[i] );

This does not work if the current value is "".

That's one of many reasons not to access module_config_t directly, but the 
helper functions.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list