[Android] Fix checksubs for files without extension

Geoffrey Métais git at videolan.org
Wed Jan 21 19:20:08 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 21 19:19:04 2015 +0100| [fd66a1dd4d4f793ab95fe43c7c7b636f3edace28] | committer: Geoffrey Métais

Fix checksubs for files without extension

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

 vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index e64cdd3..bb608bc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -173,7 +173,10 @@ public class MediaInfoFragment extends ListFragment {
         }
         for (int i = 0; i<files.length ; ++i){
             filename = Uri.decode(files[i]);
-            extension = filename.substring(filename.lastIndexOf('.'));
+            int index = filename.lastIndexOf('.');
+            if (index <= 0)
+                continue;
+            extension = filename.substring(index);
             if (!Extensions.SUBTITLES.contains(extension))
                 continue;
             if (filename.startsWith(videoName)) {



More information about the Android mailing list