Explorar o código

Bugfix: boundary_loop crash

Former-commit-id: d48fb12ca2bb25fcddfe96c305d7176decaa17a6
jmespadero %!s(int64=8) %!d(string=hai) anos
pai
achega
3cf86f1a78
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      include/igl/boundary_loop.cpp

+ 7 - 0
include/igl/boundary_loop.cpp

@@ -114,6 +114,13 @@ IGL_INLINE void igl::boundary_loop(
     }
   }
 
+  //Check for meshes without boundary
+  if (idxMax == -1)
+  {
+      L.clear();
+      return;
+  }
+
   L.resize(Lall[idxMax].size());
   for (size_t i = 0; i < Lall[idxMax].size(); ++i)
   {