File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
modules/juce_audio_basics/midi Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -688,12 +688,22 @@ bool MidiMessage::isSysEx() const noexcept
688688
689689MidiMessage MidiMessage::createSysExMessage (const void * sysexData, const int dataSize)
690690{
691+ jassert (sysexData != nullptr );
692+ jassert (dataSize > 0 );
693+
691694 HeapBlock<uint8> m (dataSize + 2 );
692695
693696 m[0 ] = 0xf0 ;
694697 memcpy (m + 1 , sysexData, (size_t ) dataSize);
695698 m[dataSize + 1 ] = 0xf7 ;
696699
700+ // The sysex data should not contain any header or tail status bytes, these
701+ // will be added automatically.
702+ #if JUCE_ASSERTIONS_ENABLED_OR_LOGGED
703+ for (auto i = 1 ; i < dataSize + 1 ; ++i)
704+ jassert (m[i] != 0xf0 && m[i] != 0xf7 );
705+ #endif
706+
697707 return MidiMessage (m, dataSize + 2 );
698708}
699709
You can’t perform that action at this time.
0 commit comments