Fix FlacStreamInfo to not call readBits with a >32 value

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161677399
This commit is contained in:
olly 2017-07-12 09:53:20 -07:00 committed by Oliver Woodman
parent 17e73bdc78
commit a39ab8161e

View File

@ -47,7 +47,8 @@ public final class FlacStreamInfo {
this.sampleRate = scratch.readBits(20);
this.channels = scratch.readBits(3) + 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
}