[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8258986: getColor throws IOOBE when PixelReader reads the same pixel twice
From:       Tom Schindl <tschindl () openjdk ! java ! net>
Date:       2021-01-29 12:35:44
Message-ID: j4fjsFNs8FgNztbJV9LVNxYfybB7KC6zXtsCsNgk2Kg=.5e6e005d-a2ab-441b-9935-27f05c5dfbf9 () github ! com
[Download RAW message or body]

On Fri, 29 Jan 2021 12:25:53 GMT, Kevin Rushforth <kcr@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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic