Commit 58267d2b authored by Rafaël Carré's avatar Rafaël Carré

lua equalizer: fix crash when not running audio filters

parent 8e1c2ef3
......@@ -71,7 +71,7 @@ static int vlclua_preamp_get( lua_State *L )
return 0;
char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( strstr ( psz_af, "equalizer" ) == NULL )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
vlc_object_release( p_aout );
......@@ -100,7 +100,7 @@ static int vlclua_preamp_set( lua_State *L )
return 0;
char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( strstr ( psz_af, "equalizer" ) == NULL )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
vlc_object_release( p_aout );
......@@ -143,7 +143,7 @@ static int vlclua_equalizer_get( lua_State *L )
float level = 0 ;
char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( strstr ( psz_af, "equalizer" ) == NULL )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
vlc_object_release( p_aout );
......@@ -195,7 +195,7 @@ static int vlclua_equalizer_set( lua_State *L )
return 0;
char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
if( strstr ( psz_af, "equalizer" ) == NULL )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
vlc_object_release( p_aout );
......
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