Skip to content

Commit

Permalink
8269091: javax/sound/sampled/Clip/SetPositionHang.java failed with Ar…
Browse files Browse the repository at this point in the history
…rayIndexOutOfBoundsException: Array index out of range: -4

Backport-of: b6a5d2082832c9d70051df8d4a5190f6a6faec58
  • Loading branch information
RealCLanger committed Aug 8, 2023
1 parent daeb362 commit 06772f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -1377,8 +1377,9 @@ public void run() {
}
}
while (doIO && thread == curThread) {
if (newFramePosition >= 0) {
clipBytePosition = newFramePosition * frameSize;
int npf = newFramePosition; // copy into local variable
if (npf >= 0) {
clipBytePosition = npf * frameSize;
newFramePosition = -1;
}
int endFrame = getFrameLength() - 1;
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/javax/sound/sampled/Clip/SetPositionHang.java
Expand Up @@ -28,7 +28,7 @@

/**
* @test
* @bug 8266421
* @bug 8266421 8269091
* @summary Tests that Clip.setFramePosition/setMicrosecondPosition do not hang.
*/
public final class SetPositionHang implements Runnable {
Expand Down

1 comment on commit 06772f1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.