From 7e1328aab0aedf2981dfffa7212b4557403232ca Mon Sep 17 00:00:00 2001 From: klemek Date: Sat, 16 May 2026 17:35:21 +0200 Subject: [PATCH] fix: check for snd_rawmidi_info_malloc --- src/midi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/midi.c b/src/midi.c index d834d98..98b4c50 100644 --- a/src/midi.c +++ b/src/midi.c @@ -74,6 +74,12 @@ void *midi_background_listen(void *args) { snd_rawmidi_info_malloc(&info); + if (info == NULL) { + log_error("(%s) failed to allocate MIDI info", device->name); + free(process_args); + pthread_exit(NULL); + } + while (!context->stop && snd_rawmidi_info(device->output, info) == 0) { bytes_read = snd_rawmidi_read(device->input, buffer, 3); if (bytes_read == 3) {