Fix for remesh modifier crash mentioned in comments of bug [#30966]
[blender.git] / 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;
        }