Commit a39ab816 by olly Committed by Oliver Woodman

Fix FlacStreamInfo to not call readBits with a >32 value

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161677399
parent 17e73bdc
...@@ -47,7 +47,8 @@ public final class FlacStreamInfo { ...@@ -47,7 +47,8 @@ public final class FlacStreamInfo {
this.sampleRate = scratch.readBits(20); this.sampleRate = scratch.readBits(20);
this.channels = scratch.readBits(3) + 1; this.channels = scratch.readBits(3) + 1;
this.bitsPerSample = scratch.readBits(5) + 1; this.bitsPerSample = scratch.readBits(5) + 1;
this.totalSamples = scratch.readBits(36); this.totalSamples = ((scratch.readBits(4) & 0xFL) << 32)
| (scratch.readBits(32) & 0xFFFFFFFFL);
// Remaining 16 bytes is md5 value // Remaining 16 bytes is md5 value
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment