On Tue, 14 Oct 2025 05:25:44 GMT, Phil Race <[email protected]> wrote:
> color is initially returned as 4 element array but we over-write with 3
> element and so next time through the loop it is used by but is too short.
> More details in JBS.
src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java line 811:
> 809: for (int x = 0; x < w; x++) {
> 810: pixel = srcRas.getDataElements(x, y, pixel);
> 811: color = srcCM.getNormalizedComponents(pixel, null,
> 0);
Since this is executed for each pixel, it will generate garbage equal to the
image size. Maybe we can cleanly split the usage of the two vars here? Note
that the bug only occurs when the source image does not use an ICC profile, but
this change would increase garbage for both ICC and non-ICC profiles.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27785#discussion_r2436869668