[Android] Fix crash while scanning a file with no tracks

Jean-Baptiste Kempf git at videolan.org
Mon Oct 1 12:03:36 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Oct  1 12:03:06 2012 +0200| [954a783e8f5cb395fcec5391f7ba4e0737d320fc] | committer: Jean-Baptiste Kempf

Fix crash while scanning a file with no tracks

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

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

diff --git a/vlc-android/src/org/videolan/vlc/Media.java b/vlc-android/src/org/videolan/vlc/Media.java
index 1d515a6..6975e97 100644
--- a/vlc-android/src/org/videolan/vlc/Media.java
+++ b/vlc-android/src/org/videolan/vlc/Media.java
@@ -162,6 +162,9 @@ public class Media implements Comparable<Media> {
     }
 
     private void extractTrackInfo(TrackInfo[] tracks) {
+        if (tracks == null)
+            return;
+
         for (TrackInfo track : tracks) {
             if (track.Type == TrackInfo.TYPE_VIDEO) {
                 mType = TYPE_VIDEO;



More information about the Android mailing list