[Android] Prevent NPE in MediaPlayer getEncodingFlags

Geoffrey Métais git at videolan.org
Thu Oct 5 10:19:56 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Oct  5 09:50:31 2017 +0200| [60cf86aa7a18c72c71621a2ea814f4340b6f799e] | committer: Geoffrey Métais

Prevent NPE in MediaPlayer getEncodingFlags

> https://code.videolan.org/videolan/vlc-android/commit/60cf86aa7a18c72c71621a2ea814f4340b6f799e
---

 libvlc/src/org/videolan/libvlc/MediaPlayer.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 09e8112c4..f88306ad1 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -417,6 +417,8 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
     }
 
     private long getEncodingFlags(int encodings[]) {
+        if (encodings == null)
+            return 0;
         long encodingFlags = 0;
         for (int encoding : encodings) {
             if (isEncoded(encoding))



More information about the Android mailing list