[Android] Prevent IndexOutOfBoundsException in video loading

Geoffrey Métais git at videolan.org
Thu Mar 2 15:11:14 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar  2 09:59:26 2017 +0100| [71b88ee109d2fc59f69957088e543bd9297c23cc] | committer: Geoffrey Métais

Prevent IndexOutOfBoundsException in video loading

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 8aa5ba6..a6bf197 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -3030,7 +3030,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             itemTitle = extras.getString(PLAY_EXTRA_ITEM_TITLE);
 
         MediaWrapper openedMedia = null;
-        if (positionInPlaylist != -1 && mService.hasMedia()) {
+        if (positionInPlaylist != -1 && mService.hasMedia() && positionInPlaylist < mService.getMedias().size()) {
             // Provided externally from AudioService
             Log.d(TAG, "Continuing playback from PlaybackService at index " + positionInPlaylist);
             openedMedia = mService.getMedias().get(positionInPlaylist);



More information about the Android mailing list