Commit 56c907c6 authored by Antoine Cellerier's avatar Antoine Cellerier

Check rate value before using.

parent 0888d465
......@@ -349,8 +349,13 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
p_input->p->title = NULL;
p_input->p->i_title_offset = p_input->p->i_seekpoint_offset = 0;
p_input->p->i_state = INIT_S;
p_input->p->i_rate = INPUT_RATE_DEFAULT
/ var_InheritFloat( p_input, "rate" );
double f_rate = var_InheritFloat( p_input, "rate" );
if( f_rate <= 0. )
{
msg_Warn( p_input, "Negative or zero rate values are forbidden" );
f_rate = 1.;
}
p_input->p->i_rate = INPUT_RATE_DEFAULT / f_rate;
p_input->p->b_recording = false;
memset( &p_input->p->bookmark, 0, sizeof(p_input->p->bookmark) );
TAB_INIT( p_input->p->i_bookmark, p_input->p->pp_bookmark );
......
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