From 9dc786f0ea236bc793cd77b365fae1fbf9772017 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 6 Oct 2015 22:29:44 +0200 Subject: [PATCH] Segfault when curve black point is moved below white point, fixes #2923 --- rtengine/diagonalcurves.cc | 6 +++++- rtengine/rawimagesource.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc index f46cdb8cb..f09eb3459 100644 --- a/rtengine/diagonalcurves.cc +++ b/rtengine/diagonalcurves.cc @@ -72,7 +72,11 @@ DiagonalCurve::DiagonalCurve (const std::vector& p, int poly_pn) if(x[0] == 0.f && x[1] == 0.f) // Avoid crash when first two points are at x = 0 (git Issue 2888) - x[1] = 0.5f; + x[1] = 0.01f; + + if(x[0] == 1.f && x[1] == 1.f) + // Avoid crash when first two points are at x = 1 (100 in gui) (git Issue 2923) + x[0] = 0.99f; if (!identity) { if (kind == DCT_Spline && N > 2) { diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 3194e2f32..a85e7a7d3 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -983,7 +983,7 @@ SSEFUNCTION int RawImageSource::findHotDeadPixels( PixelsMap &bpMap, float thres // process borders. Former version calculated the median using mirrored border which does not make sense because the original pixel loses weight // Setting the difference between pixel and median for border pixels to zero should do the job not worse then former version #ifdef _OPENMP - #pragma omp critical + #pragma omp single #endif { for(int i = 0; i < 2; i++) {