Solving issue #984: Crash on opening raw

This commit is contained in:
natureh
2011-09-14 00:41:18 +02:00
parent 3f921ea255
commit b9fb664670
2 changed files with 8 additions and 9 deletions

View File

@@ -76,10 +76,10 @@ namespace rtengine {
double const increment = 1./hashSize;
double milestone = 0.;
for (unsigned int i=0; i<(hashSize+1); i++) {
for (unsigned int i=0; i<(hashSize+1);) {
while(poly_x[polyIter] <= milestone) ++polyIter;
hash[i] = polyIter-1;
milestone += increment;
milestone = (++i)*increment;
}
hash[hashSize+1] = poly_x.size()-1;