|
1 | 1 | /* |
2 | | - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
34 | 34 |
|
35 | 35 | /** |
36 | 36 | * @test |
37 | | - * @bug 8237495 |
38 | | - * @summary fail with a dereferenced memory error when asked to send a raw 0xF7 |
| 37 | + * @bug 8237495 8301310 |
| 38 | + * @summary fail with memory errors when asked to send a sysex message starting |
| 39 | + * with 0xF7 |
39 | 40 | */ |
40 | 41 | public final class SendRawSysexMessage { |
41 | 42 |
|
@@ -113,6 +114,16 @@ private static void test(MidiDevice.Info info) throws Exception { |
113 | 114 | (byte) SPECIAL_SYSTEM_EXCLUSIVE}), -1); |
114 | 115 | System.err.println("note off"); |
115 | 116 | r.send(new ShortMessage(ShortMessage.NOTE_OFF, 5, 5), -1); |
| 117 | + System.err.println("sysex part 1 of 3"); |
| 118 | + r.send(new SysexMessage(new byte[]{ |
| 119 | + (byte) SYSTEM_EXCLUSIVE, 0x7D, 0x01, 0x02}, 4), -1); |
| 120 | + System.err.println("sysex part 2 of 3"); |
| 121 | + r.send(new SysexMessage(new byte[]{ |
| 122 | + (byte) SPECIAL_SYSTEM_EXCLUSIVE, 0x03, 0x04}, 3), -1); |
| 123 | + System.err.println("sysex part 3 of 3"); |
| 124 | + r.send(new SysexMessage(new byte[]{ |
| 125 | + (byte) SPECIAL_SYSTEM_EXCLUSIVE, 0x05, 0x06, 0x07, |
| 126 | + (byte) SPECIAL_SYSTEM_EXCLUSIVE}, 4), -1); |
116 | 127 | System.err.println("done, should quit"); |
117 | 128 | System.err.println(); |
118 | 129 | } |
|
0 commit comments