Skip to content

Commit

Permalink
Now defaulting to a command lenght of 1 if we couldn't figure it out.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMIK committed Nov 8, 2024
1 parent 302e7f8 commit dbfab29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/MIKMIDICommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ + (NSArray *)commandsWithMIDIPacket:(MIDIPacket *)inputPacket

default: {
__auto_type standardLength = MIKMIDIStandardLengthOfMessageForCommandType(commandType);
NSAssert(standardLength > 0, @"message length failed for command type %lu", commandType);
eventDataLength = (ByteCount)standardLength;
if ( standardLength > 0 ) {
eventDataLength = (ByteCount)standardLength;
} else { /* -1 or NSIntegerMin */
eventDataLength = 1; /* assume 1 and hope for the best */
}
break;
}
}
Expand Down

0 comments on commit dbfab29

Please sign in to comment.