[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:37:17 2014 +0300| [b7a17e95f3250f6cb5e95bbc8361756d1f4fbf72] | committer: hpi1

Fix possible null pointer dereference

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

 src/libbluray/bdj/java/org/havi/ui/HScene.java |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/org/havi/ui/HScene.java b/src/libbluray/bdj/java/org/havi/ui/HScene.java
index 1ef3ada..7937d32 100644
--- a/src/libbluray/bdj/java/org/havi/ui/HScene.java
+++ b/src/libbluray/bdj/java/org/havi/ui/HScene.java
@@ -250,10 +250,11 @@ public class HScene extends Container implements HComponentOrdering {
             removeAll();
 
             Graphics g = GUIManager.getInstance().getGraphics();
-            Rectangle r = getBounds();
-            g.clearRect(r.x, r.y, r.width, r.height);
-            g.dispose();
-
+            if (g != null) {
+                Rectangle r = getBounds();
+                g.clearRect(r.x, r.y, r.width, r.height);
+                g.dispose();
+            }
             if (image != null) {
                 image.flush();
             }



More information about the libbluray-devel mailing list