diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 68af84970..cf333a5d5 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -162,7 +162,8 @@ float estimate_ambient_light(const array2D &R, const array2D &G, c #ifdef _OPENMP #pragma omp parallel for schedule(dynamic) reduction(+:rr,gg,bb,n) #endif - for (const auto &p : patches) { + for (size_t i = 0; i < patches.size(); ++i) { + const auto &p = patches[i]; const int pW = min(p.first + patchsize, W); const int pH = min(p.second + patchsize, H);