[Android] MediaList: fix the moving of an item at the end of the list

Adrien Maglo git at videolan.org
Fri Jan 24 14:04:48 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jan 24 14:04:03 2014 +0100| [488136f375a1b49c6caeb4851c8cf034b8bd9943] | committer: Adrien Maglo

MediaList: fix the moving of an item at the end of the list

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=488136f375a1b49c6caeb4851c8cf034b8bd9943
---

 vlc-android/src/org/videolan/libvlc/MediaList.java |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/libvlc/MediaList.java b/vlc-android/src/org/videolan/libvlc/MediaList.java
index 20b47b3..f3de2f3 100644
--- a/vlc-android/src/org/videolan/libvlc/MediaList.java
+++ b/vlc-android/src/org/videolan/libvlc/MediaList.java
@@ -142,7 +142,8 @@ public class MediaList {
      * @throws IndexOutOfBoundsException
      */
     public void move(int startPosition, int endPosition) {
-        if(!( isValid(startPosition) && isValid(endPosition) ))
+        if (!(isValid(startPosition)
+              && endPosition >= 0 && endPosition <= mInternalList.size()))
             throw new IndexOutOfBoundsException("Indexes out of range");
 
         MediaHolder toMove = mInternalList.get(startPosition);



More information about the Android mailing list