[Android] Fix IndexOutOfBoundsException

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


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jan 27 13:13:08 2020 +0100| [5e9ae5bced52af6257b8a94fe8b37b8d89b9934b] | committer: Geoffrey Métais

Fix IndexOutOfBoundsException

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

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

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



More information about the Android mailing list