--- a/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java Fri Aug 08 16:19:36 2014 +0400
+++ b/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java Fri Aug 08 21:40:46 2014 +0400
@@ -74,14 +74,13 @@
fourcc[0] = (byte) b;
readFully(fourcc, 1, 3);
this.fourcc = new String(fourcc, "ascii");
- final long size = readUnsignedInt();
- if (size > Integer.MAX_VALUE) {
- throw new RIFFInvalidDataException("Chunk size too big");
- }
- ckSize = size;
- avail = size;
+ ckSize = readUnsignedInt();
+ avail = ckSize;
if (getFormat().equals("RIFF") || getFormat().equals("LIST")) {
+ if (avail > Integer.MAX_VALUE) {
+ throw new RIFFInvalidDataException("Chunk size too big");
+ }
byte[] format = new byte[4];
readFully(format);
this.riff_type = new String(format, "ascii");