From ceebb4c561032b11fa356715b9637dde935d4e38 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 1 Sep 2016 04:01:57 -0700 Subject: [PATCH] Fix incorrect index in DefaultAllocator.trim This could cause us to "lose" allocations backed by an initial block, meaning they became unavailable for use despite still being allocated. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=131931465 --- .../google/android/exoplayer2/upstream/DefaultAllocator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java b/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java index 7ba61a8079..5ccfa5f899 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java @@ -134,7 +134,7 @@ public final class DefaultAllocator implements Allocator { if (lowAllocation.data == initialAllocationBlock) { lowIndex++; } else { - Allocation highAllocation = availableAllocations[lowIndex]; + Allocation highAllocation = availableAllocations[highIndex]; if (highAllocation.data != initialAllocationBlock) { highIndex--; } else {