From d4f0a9a19bb48c0296bb0b56a7149b2296999e62 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Wed, 3 Apr 2019 10:14:49 +0200 Subject: [PATCH] Fix crash in histogram matching #5249 Patch by Alberto https://github.com/Beep6581/RawTherapee/issues/5249#issuecomment-477923928 --- rtengine/histmatching.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }