[vlc-commits] lua equalizer: fix crash when not running audio filters

Rafaël Carré git at videolan.org
Mon Aug 1 06:08:30 CEST 2011


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Sun Jul 31 23:27:22 2011 -0400| [58267d2b815bde8afb3afce594a33a0aa9dec4de] | committer: Rafaël Carré

lua equalizer: fix crash when not running audio filters

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58267d2b815bde8afb3afce594a33a0aa9dec4de
---

 modules/lua/libs/equalizer.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/lua/libs/equalizer.c b/modules/lua/libs/equalizer.c
index b7e0bc18..a55e3e9 100644
--- a/modules/lua/libs/equalizer.c
+++ b/modules/lua/libs/equalizer.c
@@ -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 );



More information about the vlc-commits mailing list