[libbluray-devel] Fix possible null pointer dereference

hpi1 git at videolan.org
Mon Sep 1 14:07:29 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Aug 27 12:22:53 2014 +0300| [4f8c93f8d4173ca08d229307cb1edac2dfc0beb2] | committer: hpi1

Fix possible null pointer dereference

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

 src/libbluray/bdj/java/java/awt/BDJHelper.java |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bdj/java/java/awt/BDJHelper.java b/src/libbluray/bdj/java/java/awt/BDJHelper.java
index 8bb2edd..f5a165b 100644
--- a/src/libbluray/bdj/java/java/awt/BDJHelper.java
+++ b/src/libbluray/bdj/java/java/awt/BDJHelper.java
@@ -78,8 +78,12 @@ public class BDJHelper {
                     event = new KeyEvent(focusOwner, id, when, modifiers, KeyEvent.VK_UNDEFINED, (char)keyCode);
                 else
                     event = new KeyEvent(focusOwner, id, when, modifiers, keyCode, KeyEvent.CHAR_UNDEFINED);
-                BDToolkit.getEventQueue(focusOwner).postEvent(event);
-                return true;
+
+                EventQueue eq = BDToolkit.getEventQueue(focusOwner);
+                if (eq != null) {
+                    eq.postEvent(event);
+                    return true;
+                }
             } catch (Throwable e) {
                 org.videolan.Logger.getLogger("BDJHelper").error("postKeyEvent failed: " + e);
             }



More information about the libbluray-devel mailing list