changeset in /hg/icedtea6: 2009-02-11 Omair Majid <omajid at redh...

Omair Majid omajid at redhat.com
Wed Feb 11 08:50:52 PST 2009


changeset 551c49cb2e2a in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=551c49cb2e2a
description:
	2009-02-11  Omair Majid  <omajid at redhat.com>

	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
	    (write): Throw IllegalArgumentException instead of
	    ArrayIndexOutOfBoundsException for length.
	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java
	    (read): Fixed bounds checking.

diffstat:

3 files changed, 17 insertions(+), 4 deletions(-)
ChangeLog                                                                          |    8 ++++++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java |    5 +++++
pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java |    8 ++++----

diffs (48 lines):

diff -r 24c29e381e49 -r 551c49cb2e2a ChangeLog
--- a/ChangeLog	Wed Feb 11 09:14:17 2009 -0500
+++ b/ChangeLog	Wed Feb 11 11:49:45 2009 -0500
@@ -1,3 +1,11 @@ 2009-02-11  Marc Schoenefeld <mschoene at r
+2009-02-11  Omair Majid  <omajid at redhat.com>
+
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
+	(write): Throw IllegalArgumentException instead of 
+	ArrayIndexOutOfBoundsException for length.
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java
+	(read): Fixed bounds checking.
+
 2009-02-11  Marc Schoenefeld <mschoene at redhat.com>
             Omair Majid  <omajid at redhat.com>
 
diff -r 24c29e381e49 -r 551c49cb2e2a pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Wed Feb 11 09:14:17 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Wed Feb 11 11:49:45 2009 -0500
@@ -151,6 +151,11 @@ public final class PulseAudioSourceDataL
 			throw new IllegalArgumentException(
 					"amount of data to write does not represent an integral number of frames");
 		}
+		
+		if (length < 0) {
+		    throw new IllegalArgumentException("length is negative");
+		}
+		
 		if (length < 0 || offset < 0 || offset > data.length - length) {
 			throw new ArrayIndexOutOfBoundsException(
 					"Overflow condition: buffer.length=" + data.length + 
diff -r 24c29e381e49 -r 551c49cb2e2a pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java	Wed Feb 11 09:14:17 2009 -0500
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java	Wed Feb 11 11:49:45 2009 -0500
@@ -156,10 +156,10 @@ public final class PulseAudioTargetDataL
 		if (length < 0) {
 			throw new IllegalArgumentException("length is negative");
 		}
-
-		if (length + offset > data.length) {
-			throw new ArrayIndexOutOfBoundsException("index: "
-					+ (length + offset) + " array size: " + data.length);
+		
+		if ( offset < 0 || offset > data.length - length) {
+			throw new ArrayIndexOutOfBoundsException("array size: " + data.length
+					+ " offset:" + offset + " length:" + length );
 		}
 
 		/* everything ok */



More information about the distro-pkg-dev mailing list