[libbluray-devel] BDGraphics: fix out of array access in clearRect()

hpi1 git at videolan.org
Mon Mar 24 17:27:26 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Mar 24 18:25:48 2014 +0200| [c553cfe458a6dfeeee95cf2550ec6ce254465dc1] | committer: hpi1

BDGraphics: fix out of array access in clearRect()

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

 src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
index f8de32f..49c274e 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
@@ -483,6 +483,9 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
         y += originY;
         Rectangle rect = new Rectangle(x, y, w, h);
         rect = actualClip.intersection(rect);
+        if (rect.isEmpty()) {
+            return;
+        }
         x = rect.x;
         y = rect.y;
         w = rect.width;



More information about the libbluray-devel mailing list