Correctly handle zero length fragmentRun.

This commit is contained in:
Oliver Woodman 2014-09-23 11:13:31 +01:00
parent 4fdd68facf
commit 7cb55e23f6

View File

@ -246,7 +246,7 @@ public final class FragmentedMp4Extractor implements Extractor {
@Override
public boolean seekTo(long seekTimeUs, boolean allowNoop) {
pendingSeekTimeMs = (int) (seekTimeUs / 1000);
if (allowNoop && fragmentRun != null
if (allowNoop && fragmentRun != null && fragmentRun.length > 0
&& pendingSeekTimeMs >= fragmentRun.getSamplePresentationTime(0)
&& pendingSeekTimeMs <= fragmentRun.getSamplePresentationTime(fragmentRun.length - 1)) {
int sampleIndexFound = 0;