[Android] Fix IndexOutOfBoundsException

Nicolas Pomepuy git at videolan.org
Mon Jan 27 16:52:15 CET 2020


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jan 27 16:25:55 2020 +0100| [ad33c52d4d1f260f3359e0c20b65c9f85da9c327] | committer: Geoffrey Métais

Fix IndexOutOfBoundsException

> https://code.videolan.org/videolan/vlc-android/commit/ad33c52d4d1f260f3359e0c20b65c9f85da9c327
---

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 8f29159ef..a951489d6 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -167,7 +167,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             if (!audio && position < playList.size && settings.getBoolean(VIDEO_PAUSED, false)) {
                 playList[position].addFlags(AbstractMediaWrapper.MEDIA_PAUSED)
             }
-            if (audio) playList[position].addFlags(AbstractMediaWrapper.MEDIA_FORCE_AUDIO)
+            if (audio && position < playList.size) playList[position].addFlags(AbstractMediaWrapper.MEDIA_FORCE_AUDIO)
             load(playList, position, true)
             loadingLastPlaylist = false
             if (!audio) {



More information about the Android mailing list