diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index e178906d4..f54d744c4 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -4613,13 +4613,13 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) } } else if (ri->get_colors() == 1) { for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb_red * rawData[i][j])]++; + tmphistogram[(int)(refwb[0] * rawData[i][j])]++; } } else { for (int j = start; j < end; j++) { - tmphistogram[CLIP((int)(refwb_red * rawData[i][3 * j + 0]))]++; - tmphistogram[CLIP((int)(refwb_green * rawData[i][3 * j + 1]))] += 2; - tmphistogram[CLIP((int)(refwb_blue * rawData[i][3 * j + 2]))]++; + tmphistogram[(int)(refwb[0] * rawData[i][3 * j + 0])]++; + tmphistogram[(int)(refwb[1] * rawData[i][3 * j + 1])]++; + tmphistogram[(int)(refwb[2] * rawData[i][3 * j + 2])]++; } } }