[Android] MediaGroup: fix StringIndexOutOfBoundsException

Geoffrey Métais git at videolan.org
Tue May 28 16:16:59 CEST 2019


vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 28 15:27:07 2019 +0200| [d84dd622ae8509bab983de542d925db000303a9e] | committer: Geoffrey Métais

MediaGroup: fix StringIndexOutOfBoundsException

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

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

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaGroup.java b/vlc-android/src/org/videolan/vlc/media/MediaGroup.java
index b09517019..d0d04a6da 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaGroup.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaGroup.java
@@ -103,7 +103,7 @@ public class MediaGroup extends MediaWrapper {
 
             //Handle titles starting with "The"
             int groupOffset = group.startsWith("the") ? 4 : 0;
-            if (title.startsWith("the"))
+            if (title.startsWith("the") && title.length() > 4)
                 title = title.substring(4);
 
             // find common prefix



More information about the Android mailing list