dual demosaic auto contrast: fix segfault when falling back to zero, #4866

This commit is contained in:
heckflosse
2018-10-22 17:24:36 +02:00
parent e2965cc6b4
commit be987d8f32

View File

@@ -286,6 +286,13 @@ void buildBlendMask(float** luminance, float **blend, int W, int H, float &contr
} }
} }
if(contrastThreshold == 0.f) {
for(int j = 0; j < H; ++j) {
for(int i = 0; i < W; ++i) {
blend[j][i] = amount;
}
}
} else {
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel #pragma omp parallel
#endif #endif
@@ -346,6 +353,7 @@ void buildBlendMask(float** luminance, float **blend, int W, int H, float &contr
gaussianBlur(blend, blend, W, H, 2.0); gaussianBlur(blend, blend, W, H, 2.0);
} }
} }
}
} }
int calcContrastThreshold(float** luminance, float **blend, int W, int H) { int calcContrastThreshold(float** luminance, float **blend, int W, int H) {