mirror of
https://github.com/openjdk/jdk15u.git
synced 2025-12-10 17:33:04 -06:00
8283190: Improve MIDI processing
Reviewed-by: yan Backport-of: e0329eb343661edd5066deb6ae5d99a742135831
This commit is contained in:
parent
308e2d484a
commit
a3d5c748f8
@ -380,6 +380,11 @@ final class SMFParser {
|
||||
case 0xF7:
|
||||
// sys ex
|
||||
int sysexLength = (int) readVarInt();
|
||||
if (sysexLength < 0 || sysexLength > trackLength - pos) {
|
||||
throw new InvalidMidiDataException("Message length is out of bounds: "
|
||||
+ sysexLength);
|
||||
}
|
||||
|
||||
byte[] sysexData = new byte[sysexLength];
|
||||
read(sysexData);
|
||||
|
||||
@ -392,8 +397,8 @@ final class SMFParser {
|
||||
// meta
|
||||
int metaType = readUnsigned();
|
||||
int metaLength = (int) readVarInt();
|
||||
if (metaLength < 0) {
|
||||
throw new InvalidMidiDataException("length out of bounds: "
|
||||
if (metaLength < 0 || metaLength > trackLength - pos) {
|
||||
throw new InvalidMidiDataException("Message length is out of bounds: "
|
||||
+ metaLength);
|
||||
}
|
||||
final byte[] metaData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user