Fix handling of 'no chunk readers' in AVI

Before this change the chunk readers array was accessed out of bounds in files
for which no chunk readers are created.

PiperOrigin-RevId: 704323919
This commit is contained in:
andrewlewis 2024-12-09 09:58:17 -08:00 committed by Copybara-Service
parent 1f6c795407
commit fc3f096888

View file

@ -419,7 +419,11 @@ public final class AviExtractor implements Extractor {
chunkReader.compactIndex();
}
seekMapHasBeenOutput = true;
extractorOutput.seekMap(new AviSeekMap(durationUs));
if (chunkReaders.length == 0) {
extractorOutput.seekMap(new SeekMap.Unseekable(durationUs));
} else {
extractorOutput.seekMap(new AviSeekMap(durationUs));
}
}
private long peekSeekOffset(ParsableByteArray idx1Body) {