Commit b0536aba authored by Gildas Bazin's avatar Gildas Bazin

* modules/audio_filter/equalizer.c: fixed segfault in BandsCallback().

parent 9105991c
...@@ -573,7 +573,6 @@ static void EqzClean( aout_filter_t *p_filter ) ...@@ -573,7 +573,6 @@ static void EqzClean( aout_filter_t *p_filter )
free( p_sys->f_gamma ); free( p_sys->f_gamma );
free( p_sys->f_amp ); free( p_sys->f_amp );
} }
...@@ -648,29 +647,26 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -648,29 +647,26 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
aout_filter_sys_t *p_sys = (aout_filter_sys_t *)p_data; aout_filter_sys_t *p_sys = (aout_filter_sys_t *)p_data;
char *psz_bands = newval.psz_string; char *psz_bands = newval.psz_string;
/* Same thing for bands */ /* Same thing for bands */
if( *psz_bands ) if( *psz_bands )
{ {
char *p = psz_bands; char *p = psz_bands, p_next;
int i; int i;
for( i = 0; i < p_sys->i_band; i++ ) for( i = 0; i < p_sys->i_band; i++ )
{ {
float f; /* Read dB -20/20 */
float f = strtof( p, &p_next );
/* Read dB -20/20*/ if( !p_next || p_next == p ) break; /* strtof() failed */
f = strtof( p, &p );
p_sys->f_amp[i] = EqzConvertdB( f ); p_sys->f_amp[i] = EqzConvertdB( f );
if( p == NULL ) if( !*p ) break; /* end of line */
break;
p++; p++;
if( *p == '\0' )
break;
} }
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
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