Skip to content

Commit

Permalink
VideoMetadata: avoid subtitle track index negative
Browse files Browse the repository at this point in the history
  • Loading branch information
courville committed May 24, 2024
1 parent d129d0e commit b1600e6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public AudioTrack getAudioTrack(int idx) {
}

public SubtitleTrack getSubtitleTrack(int idx) {
return mSubtitleTrackList != null && idx < mSubtitleTrackList.length ? mSubtitleTrackList[idx] : null;
return mSubtitleTrackList != null && idx < mSubtitleTrackList.length && idx >= 0 ? mSubtitleTrackList[idx] : null;
}
public int getAudioTrackNb() {
return mAudioTrackList != null ? mAudioTrackList.length : 0;
Expand Down

0 comments on commit b1600e6

Please sign in to comment.