Skip to content

Commit

Permalink
Fix Array Out of Bounds crash if no video tracks present
Browse files Browse the repository at this point in the history
  • Loading branch information
cobarx committed Jan 4, 2019
1 parent 0339727 commit 2d016e7
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,13 @@ public void setSelectedTrack(int trackType, String type, Dynamic value) {
}

if (groupIndex == C.INDEX_UNSET && trackType == C.TRACK_TYPE_VIDEO) { // Video auto
TrackGroup group = groups.get(0);
tracks = new int[group.length];
groupIndex = 0;
for (int j = 0; j < group.length; j++) {
tracks[j] = j;
if (groups.length != 0) {
TrackGroup group = groups.get(0);
tracks = new int[group.length];
groupIndex = 0;
for (int j = 0; j < group.length; j++) {
tracks[j] = j;
}
}
} else if (groupIndex == C.INDEX_UNSET) {
trackSelector.setParameters(disableParameters);
Expand Down

0 comments on commit 2d016e7

Please sign in to comment.