don't attempt MIDI playback if there are no MIDI buffers provided for processing
[ardour.git] / libs / ptformat / ptfformat.cc
index a3b18b35d5cb6f5fce90eb7395546569810de4c2..8a2f0f2c233568952644d98cae4744682c28a80a 100644 (file)
@@ -766,6 +766,14 @@ PTFFormat::parsemidi(void) {
                        m.length = midi_len;
                        m.note = midi_note;
                        m.velocity = midi_velocity;
+#if 1
+// stop gap measure to prevent crashes in ardour,
+// remove when decryption is fully solved for .ptx
+                       if ((m.velocity & 0x80) || (m.note & 0x80) ||
+                                       (m.pos & 0xff00000000LL) || (m.length & 0xff00000000LL)) {
+                               continue;
+                       }
+#endif
                        midi.push_back(m);
 
                        //fprintf(stderr, "MIDI:  Note=%d Vel=%d Start=%d(samples) Len=%d(samples)\n", midi_note, midi_velocity, midi_pos, midi_len);