delay: avoid div by zero in delay_set_duration()
This commit is contained in:
parent
bcbce9e1fb
commit
847af03dc7
1 changed files with 3 additions and 1 deletions
2
delay.c
2
delay.c
|
@ -30,7 +30,9 @@ void delay_set_time(
|
||||||
}
|
}
|
||||||
|
|
||||||
delay->duration = new_duration;
|
delay->duration = new_duration;
|
||||||
|
if( new_duration > 0 ) {
|
||||||
delay->buf_idx %= new_duration;
|
delay->buf_idx %= new_duration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void delay_process(
|
void delay_process(
|
||||||
|
|
Loading…
Reference in a new issue