ptformat: Update lib to upstream 624671c
authorDamien Zammit <damien@zamaudio.com>
Sat, 18 Feb 2017 02:16:31 +0000 (13:16 +1100)
committerDamien Zammit <damien@zamaudio.com>
Sat, 18 Feb 2017 02:18:32 +0000 (13:18 +1100)
Temporary measure to prevent bogus data being parsed:

Until .ptx decryption is fully solved, we protect
the MIDI data output against bogus values being parsed.

libs/ptformat/ptfformat.cc

index a3b18b35d5cb6f5fce90eb7395546569810de4c2..ec67fd37b358be439d48d1ec62dd047a52fc2bde 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 & 0xff00000000) || (m.length & 0xff00000000)) {
+                               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);