summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2009-02-17 16:42:17 +0000
committerHans Baier <hansfbaier@googlemail.com>2009-02-17 16:42:17 +0000
commit96d62ba6b4d1454c13c4a4d9c21f20edbdf55f61 (patch)
tree7017453316ce291c3fd06dd1b7124d294326f0cf
parentf219a53744c3ccced52070a0ebab5fbe7f9b9895 (diff)
* FIXME in midi_util.h
git-svn-id: svn://localhost/ardour2/branches/3.0@4615 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/evoral/evoral/midi_util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h
index 8caf3fddc4..fd4526d4a8 100644
--- a/libs/evoral/evoral/midi_util.h
+++ b/libs/evoral/evoral/midi_util.h
@@ -82,13 +82,13 @@ midi_event_size(const uint8_t* buffer)
if (status >= 0x80 && status < 0xF0) {
status &= 0xF0;
}
-
- // FIXME: This is not correct, read the size and verify
- // A sysex can contain the byte MIDI_CMD_COMMON_SYSEX_END, so this
- // is likely to result in corrupt buffers and catastrophic failure
+
+ // see http://www.midi.org/techspecs/midimessages.php
if (status == MIDI_CMD_COMMON_SYSEX) {
int end;
- for (end = 1; buffer[end] != MIDI_CMD_COMMON_SYSEX_END; end++) {}
+ for (end = 1; buffer[end] != MIDI_CMD_COMMON_SYSEX_END; end++) {
+ assert((buffer[end] & 0x80) == 0);
+ }
assert(buffer[end] == MIDI_CMD_COMMON_SYSEX_END);
return end + 1;
} else {