Skip to content

Commit 6e96249

Browse files
committed
Backport dadd9cd1e8434cffaafc7406a864eaa55954cfb8
1 parent fd353e3 commit 6e96249

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -811,7 +811,7 @@ private BufferedImage nonICCBIFilter(BufferedImage src,
811811
}
812812
float[] srcMinVal = new float[iccSrcNumComp];
813813
float[] srcInvDiffMinMax = new float[iccSrcNumComp];
814-
for (int i = 0; i < srcNumComp; i++) {
814+
for (int i = 0; i < iccSrcNumComp; i++) {
815815
srcMinVal[i] = cs.getMinValue(i);
816816
srcInvDiffMinMax[i] = maxNum / (cs.getMaxValue(i) - srcMinVal[i]);
817817
}
@@ -825,7 +825,7 @@ private BufferedImage nonICCBIFilter(BufferedImage src,
825825
}
826826
float[] dstMinVal = new float[iccDstNumComp];
827827
float[] dstDiffMinMax = new float[iccDstNumComp];
828-
for (int i = 0; i < dstNumComp; i++) {
828+
for (int i = 0; i < iccDstNumComp; i++) {
829829
dstMinVal[i] = cs.getMinValue(i);
830830
dstDiffMinMax[i] = (cs.getMaxValue(i) - dstMinVal[i]) / maxNum;
831831
}
@@ -878,7 +878,7 @@ private BufferedImage nonICCBIFilter(BufferedImage src,
878878
dstDiffMinMax[i] + dstMinVal[i];
879879
}
880880
if (nonICCDst) {
881-
color = srcColorSpace.fromCIEXYZ(dstColor);
881+
color = dstColorSpace.fromCIEXYZ(dstColor);
882882
for (int i = 0; i < dstNumComp; i++) {
883883
dstColor[i] = color[i];
884884
}

0 commit comments

Comments
 (0)