From f0720ff34c0e905ce819712068b5dfd8a8bd306a Mon Sep 17 00:00:00 2001 From: rom9 <4711834+rom9@users.noreply.github.com> Date: Wed, 20 May 2020 08:29:19 +0200 Subject: [PATCH] Avoid overwriting `c_black` from inside `::preprocess` when re-computing multipliers according to selected preprocess WB mode. Fixes #5765. --- rtengine/rawimagesource.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index f94070f2d..77a5ff9fc 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1235,7 +1235,8 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le { // Recalculate the scaling coefficients, using auto WB if selected in the Preprocess WB param. // Auto WB gives us better demosaicing and CA auto-correct performance for strange white balance settings (such as UniWB) - ri->get_colorsCoeff( ref_pre_mul, scale_mul, c_black, raw.preprocessWB.mode == RAWParams::PreprocessWB::Mode::AUTO); + float dummy_cblk[4] = { 0.f }; // Avoid overwriting c_black, see issue #5676 + ri->get_colorsCoeff( ref_pre_mul, scale_mul, dummy_cblk, raw.preprocessWB.mode == RAWParams::PreprocessWB::Mode::AUTO); refwb_red = ri->get_pre_mul(0) / ref_pre_mul[0]; refwb_green = ri->get_pre_mul(1) / ref_pre_mul[1];