summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-07-05 13:45:06 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-07-05 13:45:17 -0400
commit9da1253288a035738db1c5c81050cbe78c98dbfd (patch)
tree3c05ba9e60cccdd54548cffad084b91d8188afc0 /libs/evoral
parent027d0efc2d949d7d5b1bb83560d17ffca5ba60d5 (diff)
system common and system realtime messages are not valid in SMF files
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/src/SMF.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index b4fa4a16c8..9bffa59805 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -367,6 +367,26 @@ SMF::append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf, eve
printf("%X ", buf[i]);
} printf("\n"); */
+ switch (buf[0]) {
+ case 0xf1:
+ case 0xf2:
+ case 0xf3:
+ case 0xf4:
+ case 0xf5:
+ case 0xf6:
+ case 0xf8:
+ case 0xf9:
+ case 0xfa:
+ case 0xfb:
+ case 0xfc:
+ case 0xfd:
+ case 0xfe:
+ case 0xff:
+ /* System Real Time or System Common event: not valid in SMF
+ */
+ return;
+ }
+
if (!midi_event_is_valid(buf, size)) {
cerr << "WARNING: SMF ignoring illegal MIDI event" << endl;
return;