FlacExtractor: Fix possible skipping of frame boundaries

PiperOrigin-RevId: 288304477
This commit is contained in:
olly 2020-01-06 16:21:38 +00:00 committed by Oliver Woodman
parent 24743c77ce
commit 9618e5e00f

View File

@ -272,7 +272,7 @@ public final class FlacExtractor implements Extractor {
// Skip frame search on the bytes within the minimum frame size.
if (currentFrameBytesWritten < minFrameSize) {
buffer.skipBytes(Math.min(minFrameSize, buffer.bytesLeft()));
buffer.skipBytes(Math.min(minFrameSize - currentFrameBytesWritten, buffer.bytesLeft()));
}
long nextFrameFirstSampleNumber = findFrame(buffer, foundEndOfInput);