mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-30 16:01:51 +00:00
fix endless loop in fluid_sample_timer_process()
This commit is contained in:
parent
b40fb9d782
commit
df4c9878de
1 changed files with 3 additions and 3 deletions
|
@ -489,13 +489,13 @@ void fluid_sample_timer_process(fluid_synth_t* synth)
|
|||
unsigned int ticks = fluid_synth_get_ticks(synth);
|
||||
|
||||
for (st=synth->sample_timers; st; st=stnext) {
|
||||
/* st may be freed in the callback below. cache it's successor now to avoid use after free */
|
||||
stnext = st->next;
|
||||
|
||||
if (st->isfinished) {
|
||||
continue;
|
||||
}
|
||||
|
||||
msec = (long) (1000.0*((double) (ticks - st->starttick))/synth->sample_rate);
|
||||
/* st may be freed in the callback below. cache it's successor now to avoid use after free */
|
||||
stnext = st->next;
|
||||
cont = (*st->callback)(st->data, msec);
|
||||
if (cont == 0) {
|
||||
st->isfinished = 1;
|
||||
|
|
Loading…
Reference in a new issue