Fix a race in get_dark_channel()

This commit is contained in:
Ingo Weyrich 2019-02-18 15:25:35 +01:00 committed by GitHub
parent c85dc2811b
commit e2154f9feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ int get_dark_channel(const array2D<float> &R, const array2D<float> &G, const arr
int npatches = 0;
#ifdef _OPENMP
#pragma omp parallel for if (multithread)
#pragma omp parallel for reduction(+:npatches) if (multithread)
#endif
for (int y = 0; y < H; y += patchsize) {
int pH = min(y+patchsize, H);