浏览代码

fixed an assert in min_quad_with_fixed: size() could be negative if the matrix is too large (int overflow)

Former-commit-id: 63651ec958f793bd1a7385b8e0983598ac0d8e87
Daniele Panozzo 9 年之前
父节点
当前提交
539e034e9f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/igl/min_quad_with_fixed.cpp

+ 1 - 1
include/igl/min_quad_with_fixed.cpp

@@ -94,7 +94,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_precompute(
 
 
   SparseMatrix<T> Auu;
   SparseMatrix<T> Auu;
   slice(A,data.unknown,data.unknown,Auu);
   slice(A,data.unknown,data.unknown,Auu);
-  assert(Auu.size() > 0 && "There should be at least one unknown.");
+  assert(Auu.size() != 0 && Auu.rows() > 0 && "There should be at least one unknown.");
 
 
   // Positive definiteness is *not* determined, rather it is given as a
   // Positive definiteness is *not* determined, rather it is given as a
   // parameter
   // parameter