fix: check for snd_rawmidi_info_malloc
This commit is contained in:
@@ -74,6 +74,12 @@ void *midi_background_listen(void *args) {
|
|||||||
|
|
||||||
snd_rawmidi_info_malloc(&info);
|
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) {
|
while (!context->stop && snd_rawmidi_info(device->output, info) == 0) {
|
||||||
bytes_read = snd_rawmidi_read(device->input, buffer, 3);
|
bytes_read = snd_rawmidi_read(device->input, buffer, 3);
|
||||||
if (bytes_read == 3) {
|
if (bytes_read == 3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user