Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Thread Tools Display Modes
Old 06-13-2021, 09:57 PM   #1
Human being with feelings
lexomir's Avatar
Join Date: Oct 2018
Posts: 39
Default Deadlock after calling MIDI_GetAllEvts (FIXED)

Calling MIDI_GetAllEvts with a buffer size that is too small will corrupt the take, so next time the playhead reaches it the audio engine will deadlock.

Version: 6.29 dev0613a (but probably existed before)

int bufSize = 1024;
std::vector<char> eventbuffer(bufSize);
auto take = ::GetActiveTake(::GetSelectedMediaItem(0, 0));
bool succ = MIDI_GetAllEvts(take, eventbuffer.data(), &bufSize);

I assumed that MIDI_GetAllEvts would return a cropped version of the buffer, and I could grow my vector recursively until I grabbed all the events.

All it takes is one call to MIDI_GetAllEvts with a smaller bufSize to corrupt playback of the take.

Last edited by lexomir; 06-13-2021 at 10:09 PM.
lexomir is offline   Reply With Quote
Old 06-16-2021, 04:47 AM   #2
Justin's Avatar
Join Date: Jan 2005
Location: NYC
Posts: 15,701

Thanks, fixing!
Justin is online now   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 05:55 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.