[Android] AudioService: fix potential NullDereference

Jean-Baptiste Kempf git at videolan.org
Fri Jul 18 20:46:03 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jul 18 20:07:38 2014 +0200| [f5ff08b98becd614592169e80f82f9927a366106] | committer: Jean-Baptiste Kempf

AudioService: fix potential NullDereference

So, the intent can be null, but the default implementation cannot cope
with it?

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

 vlc-android/src/org/videolan/vlc/audio/AudioService.java |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/audio/AudioService.java b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
index e9fc12b..2c346b8 100644
--- a/vlc-android/src/org/videolan/vlc/audio/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
@@ -261,6 +261,8 @@ public class AudioService extends Service {
 
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
+        if (intent == null)
+            return START_STICKY;
         updateWidget(this);
         return super.onStartCommand(intent, flags, startId);
     }



More information about the Android mailing list