summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorpepe <[email protected]>2007-03-09 06:01:25 +0000
committerpepe <[email protected]>2007-03-09 06:01:25 +0000
commitba619e48079d937ff38a9359ae3a715cb450221f (patch)
treeb4ea360a6eb958f1fc7dc6a282517c44ea308b28 /src
parent637d8427266fd3108764700b9f95d9a3b03893ff (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/ImageComponentRetained.java4
1 files changed, 4 insertions, 0 deletions
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) {