[Android] User can input wtf Uris

Geoffrey Métais git at videolan.org
Fri Jun 12 17:29:25 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun 12 17:25:39 2015 +0200| [31e6b1736b7523c0acc954d20a638c6af5a5a5e1] | committer: Geoffrey Métais

User can input wtf Uris

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 07614de..07d621e 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1163,6 +1163,8 @@ public class PlaybackService extends Service {
                 f = new File(new URI(location));
             } catch (URISyntaxException e) {
                 return false;
+            } catch (IllegalArgumentException e) {
+                return false;
             }
             if (!f.isFile())
                 return false;
@@ -1349,7 +1351,7 @@ public class PlaybackService extends Service {
 
             for (int i = 0; i < mediaPathList.size(); i++) {
                 String location = mediaPathList.get(i);
-                MediaWrapper mediaWrapper = db.getMedia(AndroidUtil.LocationToUri(location));
+                MediaWrapper mediaWrapper = db.getMedia(Uri.parse(location));
                 if (mediaWrapper == null) {
                     if (!validateLocation(location)) {
                         Log.w(TAG, "Invalid location " + location);



More information about the Android mailing list