diff options
author | Stefan Westerfeld <stefan@space.twc.de> | 2019-11-26 11:22:04 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-11-26 17:09:11 +0100 |
commit | be1012d64eb7a4b462a7db810923b0b28563f3f9 (patch) | |
tree | 4371b7e447e49f304d8a582cd13ea3c0e68f423f /libs | |
parent | 7d8918034a77168abcb0ee750762d2ed55646fae (diff) |
Fix thread-safety issue in a-fluidsynth.
This fix ensures that the a-fluidsynth "synth" object is not used in two
threads at the same time during midi event handling (run() in RT thread vs.
load_sf2() in worker thread), which could result in crashes.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc index cde370ead5..1ec184fdf3 100644 --- a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc +++ b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc @@ -514,7 +514,7 @@ run (LV2_Handle instance, uint32_t n_samples) } } else if (ev->body.type == self->midi_MidiEvent) { - if (ev->body.size > 3 || ev->time.frames >= n_samples) { + if (ev->body.size > 3 || ev->time.frames >= n_samples || self->reinit_in_progress) { continue; } |