fix: add NULL checks for clip buffer and MIDI events in process callback
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
@@ -533,7 +533,11 @@ AppState reducer(AppState state, Action action) {
|
||||
mclip->event_count = 0;
|
||||
mclip->read_index = 0;
|
||||
mclip->max_events = MAX_MIDI_EVENTS;
|
||||
// events pointer should already be valid from init
|
||||
// Ensure events pointer is valid
|
||||
if (mclip->events == NULL) {
|
||||
mclip->events = (MidiEvent *)calloc(MAX_MIDI_EVENTS, sizeof(MidiEvent));
|
||||
mclip->max_events = MAX_MIDI_EVENTS;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Carla host
|
||||
|
||||
Reference in New Issue
Block a user