[libbluray-devel] Fix possible null pointer dereference

hpi1 git at videolan.org
Mon Sep 8 11:42:48 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Sep  8 11:39:59 2014 +0300| [81efb3864e7ff05b18211c9a1cc2007be0201a01] | committer: hpi1

Fix possible null pointer dereference

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=81efb3864e7ff05b18211c9a1cc2007be0201a01
---

 .../media/content/playlist/VideoFormatControlImpl.java       |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java
index 24ff97a..7de0db2 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java
@@ -43,10 +43,12 @@ public class VideoFormatControlImpl implements VideoFormatControl {
         if ((ci == null) ||(ci.getVideoStreamCount() <= 0))
             return ASPECT_RATIO_UNKNOWN;
         Dimension aspect = ci.getVideoStreams()[0].getVideoAspectRatio();
-        if ((aspect.width == 4) && (aspect.height == 3))
-            return ASPECT_RATIO_4_3;
-        if ((aspect.width == 16) && (aspect.height == 9))
-            return ASPECT_RATIO_16_9;
+        if (aspect != null) {
+            if ((aspect.width == 4) && (aspect.height == 3))
+                return ASPECT_RATIO_4_3;
+            if ((aspect.width == 16) && (aspect.height == 9))
+                return ASPECT_RATIO_16_9;
+        }
         return ASPECT_RATIO_UNKNOWN;
     }
 



More information about the libbluray-devel mailing list