[libbluray-devel] BDGraphics.getFont(): do not return null

hpi1 git at videolan.org
Mon Jul 25 18:16:57 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Jul 25 15:27:54 2016 +0300| [049484294a5a9bd19297288d6f8d0bc194654cdf] | committer: hpi1

BDGraphics.getFont(): do not return null

Do not crash when trying to draw with disposed BDGraphics object.

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

 src/libbluray/bdj/java/java/awt/BDGraphicsBase.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
index 80db4b0..30f1546 100644
--- a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
+++ b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
@@ -208,6 +208,8 @@ abstract class BDGraphicsBase extends DVBGraphics implements ConstrainableGraphi
     }
 
     public Font getFont() {
+        if (font == null)
+            return DEFAULT_FONT;
         return font;
     }
 



More information about the libbluray-devel mailing list