Integrated: 4954405: Data buffers created with an offset are unusable

Phil Race prr at openjdk.org
Tue Nov 4 21:53:08 UTC 2025


On Tue, 14 Oct 2025 03:29:00 GMT, Phil Race <prr at openjdk.org> wrote:

> ByteInterleavedRaster is not including the DataBuffer offset in returns from getDataElements
> The super-class sets it in the constructor which runs very much like this subclass except it omits this.
> The parent class of ByteInterleavedRaster is ByteComponentRaster and it uses the DataBuffer offset
> to adjust dataOffsets values used in all calculations.
> 
> Instead ByteInterleavedRaster  does something a bit different than other classes where it includes it in some instance vars
> that also have additional offsets that apply for getPixels and getSamples but aren't used in getDataElements.
> 
> It looks to me as if this is what ByteInterleavedRaster should also do instead.
> All existing tests pass, and this resolves the specific complaint in the bug report.

This pull request has now been integrated.

Changeset: 146f8a83
Author:    Phil Race <prr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/146f8a83f9195ff246e2c3803c79171509df7d24
Stats:     75 lines in 2 files changed: 73 ins; 0 del; 2 mod

4954405: Data buffers created with an offset are unusable

Reviewed-by: avu, psadhukhan, jdv

-------------

PR: https://git.openjdk.org/jdk/pull/27782


More information about the client-libs-dev mailing list