diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index f91086285..79c40fba3 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -109,7 +109,7 @@ void mappingToCurve(const std::vector &mapping, std::vector &curve) } } if (idx == int(mapping.size())) { - for (idx = 1; idx < int(mapping.size()); ++idx) { + for (idx = 1; idx < int(mapping.size())-1; ++idx) { if (mapping[idx] >= idx) { break; }