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