JDK-6740210 : Update Gervill with more post 1.0 fixes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: OpenJDK6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-08-22
  • Updated: 2011-01-19
  • Resolved: 2008-08-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Since the previous update to Gervill was integrated (6717691), the CVS master has been changed.  Those changes should be incorporated too.

Comments
SUGGESTED FIX Interal webrev at: http://javaweb.sfbay/~darcy/Webrevs/6740210 Patch file: --- old/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Thu Aug 21 21:06:18 2008 +++ new/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Thu Aug 21 21:06:18 2008 @@ -62,7 +62,7 @@ protected static final String INFO_DESCRIPTION = "Software Sound Mixer"; - protected static final String INFO_VERSION = "0.9"; + protected static final String INFO_VERSION = "1.0"; protected final static Mixer.Info info = new Info(); --- old/src/share/classes/com/sun/media/sound/ModelInstrument.java Thu Aug 21 21:06:20 2008 +++ new/src/share/classes/com/sun/media/sound/ModelInstrument.java Thu Aug 21 21:06:20 2008 @@ -88,10 +88,10 @@ // This information is generated from ModelPerformer.getName() // returned from getPerformers(). public String[] getKeys() { - String[] keys = new String[127]; + String[] keys = new String[128]; for (ModelPerformer performer : getPerformers()) { for (int k = performer.getKeyFrom(); k <= performer.getKeyTo(); k++) { - if (keys[k] == null) { + if (k >= 0 && k < 128 && keys[k] == null) { String name = performer.getName(); if (name == null) name = "untitled"; --- old/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Thu Aug 21 21:06:21 2008 +++ new/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Thu Aug 21 21:06:21 2008 @@ -45,7 +45,7 @@ private long fileoffset; private byte[] buffer; private long offset; - private long len; + private final long len; private class RandomFileInputStream extends InputStream { @@ -107,11 +107,12 @@ } public int read(byte[] b) throws IOException { + int len = b.length; if (len > left) len = (int)left; if (left == 0) return -1; - int len = raf.read(b); + len = raf.read(b, 0, len); if (len == -1) return -1; left -= len; @@ -119,12 +120,12 @@ } public int read() throws IOException { - if (len == 0) + if (left == 0) return -1; int b = raf.read(); if (b == -1) return -1; - len--; + left--; return b; } @@ -137,15 +138,15 @@ long beginIndex, long endIndex, boolean independent) { this.root = parent.root; this.offset = 0; - this.len = parent.len; + long parent_len = parent.len; if (beginIndex < 0) beginIndex = 0; - if (beginIndex > len) - beginIndex = len; + if (beginIndex > parent_len) + beginIndex = parent_len; if (endIndex < 0) endIndex = 0; - if (endIndex > len) - endIndex = len; + if (endIndex > parent_len) + endIndex = parent_len; if (beginIndex > endIndex) beginIndex = endIndex; offset = beginIndex;
25-08-2008

EVALUATION Yes.
22-08-2008