mirror of
https://github.com/samsonjs/media.git
synced 2026-04-21 13:55:47 +00:00
Don't overflow when dealing with large segment numbers
Issue: #2311 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144182445
This commit is contained in:
parent
ce03b8c246
commit
444811c010
1 changed files with 1 additions and 1 deletions
|
|
@ -143,7 +143,7 @@ public abstract class SegmentBase {
|
|||
} else {
|
||||
// The high index cannot be unbounded. Identify the segment using binary search.
|
||||
while (lowIndex <= highIndex) {
|
||||
int midIndex = (lowIndex + highIndex) / 2;
|
||||
int midIndex = lowIndex + (highIndex - lowIndex) / 2;
|
||||
long midTimeUs = getSegmentTimeUs(midIndex);
|
||||
if (midTimeUs < timeUs) {
|
||||
lowIndex = midIndex + 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue