Commit 4e72534d authored by Laurent Aimar's avatar Laurent Aimar

Check against too low sample rate and 0 channel count (avoid division by 0)

parent 37402ad5
......@@ -59,6 +59,11 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
p_format->i_channels );
return NULL;
}
if( p_format->i_channels <= 0 )
{
msg_Err( p_aout, "no audio channels" );
return NULL;
}
if( p_format->i_rate > 192000 )
{
......@@ -66,6 +71,12 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
p_format->i_rate );
return NULL;
}
if( p_format->i_rate < 4000 )
{
msg_Err( p_aout, "too low audio sample frequency (%u)",
p_format->i_rate );
return NULL;
}
/* We can only be called by the decoder, so no need to lock
* p_input->lock. */
......
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