[OpenJDK 2D-Dev] [9] RFR: JDK-8167278: ArrayIndexOutOfBoundsException when calling ImageIO.read(InputStream) with RLE4 BMP

Brian Burkhalter brian.burkhalter at oracle.com
Sat Jan 21 00:34:40 UTC 2017


On Jan 20, 2017, at 4:30 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

>> That is worrying me since I don't follow these lines are part of that:-
>> 1684                     // Move to the position (xoff, yoff). Since l-is used
>> 1685                     // to index into the scanline buffer, the calculation
>> 1686                     // must be limited by the size
>> 1687                     l += xoff + yoff*width;
>> 1688                     l %= width;
>> 1687 was already there but 1688 and the comment are new and 1688 looks wrong to me
>> as it would seem to throw away the y it just added in ...
> 
> Indeed, if xoff is in the half-closed interval [0,width), then (xoff + yoff*width) % width == xoff.

This does not however account for the accumulation into “l” which might negate my observation.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20170120/dbec841d/attachment.html>


More information about the 2d-dev mailing list