]> git.lizzy.rs Git - plan9front.git/commitdiff
midi: properly skip sysex messages
authorqwx <devnull@localhost>
Tue, 10 Jul 2018 21:26:17 +0000 (23:26 +0200)
committerqwx <devnull@localhost>
Tue, 10 Jul 2018 21:26:17 +0000 (23:26 +0200)
this fixes playing any midi files containing such messages
example: prince of persia midis from vgmpf wiki

sys/src/games/midi.c

index 0b74bdc719cd63fc3f0491b72716b926a4eac13b..c6535219d6581ac6036771dd99486bc165e991d5 100644 (file)
@@ -181,6 +181,11 @@ readevent(Tracker *src)
                get16(src);
                break;
        case 0xF:
+               if((t & 0xF) == 0){
+                       while(get8(src) != 0xF7)
+                               ;
+                       return;
+               }
                t = get8(src);
                n = get8(src);
                switch(t){