Commit e0a00502 by sammon Committed by Oliver Woodman

Avoid exception when creating ChunkIndex with length = 0.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150908893
parent 8f636991
...@@ -61,7 +61,11 @@ public final class ChunkIndex implements SeekMap { ...@@ -61,7 +61,11 @@ public final class ChunkIndex implements SeekMap {
this.durationsUs = durationsUs; this.durationsUs = durationsUs;
this.timesUs = timesUs; this.timesUs = timesUs;
length = sizes.length; length = sizes.length;
durationUs = durationsUs[length - 1] + timesUs[length - 1]; if (length > 0) {
durationUs = durationsUs[length - 1] + timesUs[length - 1];
} else {
durationUs = 0;
}
} }
/** /**
......
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