From ba619e48079d937ff38a9359ae3a715cb450221f Mon Sep 17 00:00:00 2001 From: pepe Date: Fri, 9 Mar 2007 06:01:25 +0000 Subject: Issue 381: ByRef, yDown, 4BYTE_ABGR throws ArrayIndexOOB Exception git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@791 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/classes/share/javax/media/j3d/ImageComponentRetained.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/classes/share/javax/media/j3d/ImageComponentRetained.java b/src/classes/share/javax/media/j3d/ImageComponentRetained.java index 84efb72..8d0b056 100644 --- a/src/classes/share/javax/media/j3d/ImageComponentRetained.java +++ b/src/classes/share/javax/media/j3d/ImageComponentRetained.java @@ -2022,6 +2022,10 @@ abstract class ImageComponentRetained extends NodeComponentRetained { ((DataBufferByte)bi.getRaster().getDataBuffer()).getData(); // Multiply by 4 to get the byte incr and start point j = 0; + + //Issue 381: dstBegin contains pixel count, but we are looping over byte count. In case of YDown, it contains a count that is decremented and if we do not multiply, we have an AIOOB thrown at 25% of the copy. + dstBegin <<= 2; + for(h = 0; h < height; h++, dstBegin += (dstInc << 2)) { i = dstBegin; for (w = 0; w < width; w++, j+=4) { -- cgit v1.2.3