mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-01 00:21:14 +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);
|
unsigned int ticks = fluid_synth_get_ticks(synth);
|
||||||
|
|
||||||
for (st=synth->sample_timers; st; st=stnext) {
|
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) {
|
if (st->isfinished) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
msec = (long) (1000.0*((double) (ticks - st->starttick))/synth->sample_rate);
|
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);
|
cont = (*st->callback)(st->data, msec);
|
||||||
if (cont == 0) {
|
if (cont == 0) {
|
||||||
st->isfinished = 1;
|
st->isfinished = 1;
|
||||||
|
|
Loading…
Reference in a new issue