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 )
free( p_sys->f_gamma );
free( p_sys->f_amp );
}
......@@ -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 )
{
aout_filter_sys_t *p_sys = (aout_filter_sys_t *)p_data;
char *psz_bands = newval.psz_string;
/* Same thing for bands */
if( *psz_bands )
{
char *p = psz_bands;
char *p = psz_bands, p_next;
int i;
for( i = 0; i < p_sys->i_band; i++ )
{
float f;
/* Read dB -20/20*/
f = strtof( p, &p );
/* Read dB -20/20 */
float f = strtof( p, &p_next );
if( !p_next || p_next == p ) break; /* strtof() failed */
p_sys->f_amp[i] = EqzConvertdB( f );
if( p == NULL )
break;
if( !*p ) break; /* end of line */
p++;
if( *p == '\0' )
break;
}
}
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