[Android] Fix potential null dereference

Jean-Baptiste Kempf git at videolan.org
Thu May 22 15:59:38 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu May 22 15:37:11 2014 +0200| [2b23744edd0ac3693ae176a8548dd57dfbea30ee] | committer: Jean-Baptiste Kempf

Fix potential null dereference

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index d420193..4e864b0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1526,7 +1526,8 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                 Log.d(TAG, "Pixel format is YV12");
             else
                 Log.d(TAG, "Pixel format is other/unknown");
-            mLibVLC.attachSurface(holder.getSurface(), VideoPlayerActivity.this);
+            if(holder != null)
+                mLibVLC.attachSurface(holder.getSurface(), VideoPlayerActivity.this);
         }
 
         @Override



More information about the Android mailing list