diff options
| author | Oli Larkin <olilarkin@googlemail.com> | 2014-07-20 00:28:26 +0100 |
|---|---|---|
| committer | Oli Larkin <olilarkin@googlemail.com> | 2014-07-20 00:28:26 +0100 |
| commit | 4e5974b6e3c805183c2dc33ecab829ff9b89c406 (patch) | |
| tree | 3e1c50fb889d840a326f2816a635a6f6c759b58e | |
| parent | 94a04ef1ee3fe9da283aebe35c94754d921837e3 (diff) | |
add test for validity of packet pointer
| -rw-r--r-- | RtMidi.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1023,7 +1023,7 @@ void MidiOutCore :: sendMessage( std::vector<unsigned char> *message ) MIDIPacket *packet = MIDIPacketListInit( packetList ); ByteCount remainingBytes = nBytes; - while (remainingBytes) { + while (remainingBytes && packet) { ByteCount bytesForPacket = remainingBytes > 65535 ? 65535 : remainingBytes; // 65535 = maximum size of a MIDIPacket const Byte* dataStartPtr = (const Byte *) &message->at( nBytes - remainingBytes ); packet = MIDIPacketListAdd( packetList, listSize, packet, timeStamp, bytesForPacket, dataStartPtr); |
