Fix for remesh modifier crash mentioned in comments of bug [#30966]
authorNicholas Bishop <nicholasbishop@gmail.com>
Mon, 16 Apr 2012 01:18:02 +0000 (01:18 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Mon, 16 Apr 2012 01:18:02 +0000 (01:18 +0000)
Reading in triangles now skips any NaN coordinates.

intern/dualcon/intern/dualcon_c_api.cpp

index d710ada48bcd29e190d1863aff0cba6b3982224c..6f04922bb9492b69058e95bfa744041640ef3ef9 100644 (file)
@@ -113,6 +113,15 @@ public:
                        curface++;
                }
 
+               /* remove triangle if it contains invalid coords */
+               for(int i = 0; i < 3; i++) {
+                       const float *co = t->vt[i];
+                       if(isnan(co[0]) || isnan(co[1]) || isnan(co[2])) {
+                               delete t;
+                               return getNextTriangle();
+                       }
+               }
+
                return t;
        }