mirror of
https://github.com/androidx/media.git
synced 2025-05-09 16:40:55 +08:00
Avoid exception when creating ChunkIndex with length = 0.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150908893
This commit is contained in:
parent
8f636991ad
commit
e0a00502a7
@ -61,7 +61,11 @@ public final class ChunkIndex implements SeekMap {
|
||||
this.durationsUs = durationsUs;
|
||||
this.timesUs = timesUs;
|
||||
length = sizes.length;
|
||||
durationUs = durationsUs[length - 1] + timesUs[length - 1];
|
||||
if (length > 0) {
|
||||
durationUs = durationsUs[length - 1] + timesUs[length - 1];
|
||||
} else {
|
||||
durationUs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user