mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-26 17:50:56 +00:00
winmm_midi: Fix midi_write_long_event unable to send sysex correctly (#16804)
data size has to be DWORD aligned. Fix https://github.com/libretro/RetroArch/issues/16790 review before merge for confirmation/corrections: @LibretroAdmin @zoltanvb and others
This commit is contained in:
parent
3ba8171ed8
commit
240e5eb9e5
@ -343,6 +343,9 @@ static bool winmm_midi_write_long_event(winmm_midi_buffer_t *buf,
|
||||
{
|
||||
DWORD i = buf->header.dwBytesRecorded / sizeof(DWORD);
|
||||
|
||||
/* data size has to be DWORD aligned */
|
||||
data_size = (data_size + (sizeof(DWORD) - 1)) & ~(sizeof(DWORD) - 1);
|
||||
|
||||
if (buf->header.dwBytesRecorded + sizeof(DWORD) * 3 + data_size >
|
||||
sizeof(DWORD) * WINMM_MIDI_BUF_LEN)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user