[libbluray-devel] Fix out of bounds check

hpi1 git at videolan.org
Mon Feb 20 18:28:53 CET 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 19 16:08:02 2017 +0200| [eab0b97ff1217e49d8ef6f8337640486bef9d17b] | committer: hpi1

Fix out of bounds check

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

 src/libbluray/bdj/java/org/dvb/ui/DVBBufferedImage.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bdj/java/org/dvb/ui/DVBBufferedImage.java b/src/libbluray/bdj/java/org/dvb/ui/DVBBufferedImage.java
index 740847c..2e45e89 100644
--- a/src/libbluray/bdj/java/org/dvb/ui/DVBBufferedImage.java
+++ b/src/libbluray/bdj/java/org/dvb/ui/DVBBufferedImage.java
@@ -135,8 +135,8 @@ public class DVBBufferedImage extends Image {
 
         int width = bufferedImage.getWidth();
         int height = bufferedImage.getHeight();
-        if (startX < 0 || startY < 0 || startX + w >= width || startY + height >= height) {
-            throw new ArrayIndexOutOfBoundsException(err("getRGB out of bounds"));
+        if (startX < 0 || startY < 0 || startX + w > width || startY + h > height) {
+            throw new ArrayIndexOutOfBoundsException(err("getRGB(array) out of bounds"));
         }
 
         return bufferedImage.getRGB(startX, startY, w, h, rgbArray, offset, scansize);



More information about the libbluray-devel mailing list