Fix segfault when dehaze depth map is enabled

This commit is contained in:
Ingo Weyrich 2019-02-18 16:56:39 +01:00 committed by GitHub
parent e2154f9feb
commit 8d8aeb00a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ void ImProcFunctions::dehaze(Imagefloat *img)
}
float mt = max(t[y][x], t0, tl + teps, tu + teps);
if (params->dehaze.showDepthMap) {
img->r(y, x) = img->g(y, x) = img->b(y, x) = 1.f - mt;
img->r(y, x) = img->g(y, x) = img->b(y, x) = LIM01(1.f - mt);
} else {
float r = (rgb[0] - ambient[0]) / mt + ambient[0];
float g = (rgb[1] - ambient[1]) / mt + ambient[1];