RFR: 8258986: getColor throws IOOBE when PixelReader reads the same pixel twice

Tom Schindl tschindl at openjdk.java.net
Fri Jan 29 12:35:44 UTC 2021

On Fri, 29 Jan 2021 12:25:53 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/Image.java line 654:
>>> 652:             }
>>> 653:             if (pixelScale != 1.0f) {
>>> 654:                 pixelaccessor = new ScaledAccessor<>(pixelaccessor, pixelScale);
>> is that really correct? I think you should not overwrite/save the scaled pixelAccessor in the instance variable - if I read that correct with this change the following happens: if I call getPixelAccessor() 3 times I get a ScaledAccessor wrapping a ScaleAccessor wrapping a ScaledAccessor, wrapping one of ByteAccess, ByteRgbAccess, IntAccess
> No, that’s what used to happen before this fix.
> The fix moves the wrapping of the pixelAccessor with a ScaledPixelAxcessor inside the null check so it’s now only done once.

ah I missed that the lines moved up inside the first if-check


PR: https://git.openjdk.java.net/jfx/pull/389

More information about the openjfx-dev mailing list