fix: add null-checks for MIDI ports and use atomic access for channel active flag

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-09 09:57:36 +00:00
parent 74a190c70c
commit c0a0a6e968
4 changed files with 36 additions and 31 deletions

View File

@@ -34,6 +34,7 @@ static unsigned char midi_inject_velocity = 0;
static int midi_inject_process(jack_nframes_t nframes, void *arg) {
(void)arg;
if (!midi_inject_port) return 0;
void *port_buf = jack_port_get_buffer(midi_inject_port, nframes);
if (!port_buf) return 0;
jack_midi_clear_buffer(port_buf);