[Android] [PATCH] LibVLC: fix crash when getMachineSpecs() return null

Thomas Guillem tom at gllm.fr
Wed Oct 22 15:54:48 CEST 2014


It can happen with libvlcjni.so library is not found.
---
 vlc-android/src/org/videolan/libvlc/LibVLC.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 23bd241..8d5ad0e 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -409,6 +409,8 @@ public class LibVLC {
              * Skip non-key (3) for all devices that don't meet anything above
              */
             LibVlcUtil.MachineSpecs m = LibVlcUtil.getMachineSpecs();
+            if (m == null)
+                return ret;
             if( (m.hasArmV6 && !(m.hasArmV7)) || m.hasMips )
                 ret = 4;
             else if(m.frequency >= 1200 && m.processors > 2)
-- 
2.1.0



More information about the Android mailing list