소스 검색

assert before resize

Former-commit-id: 89a2c7a6b72dfc64b86e47a01cbbe2528dbf570a
Alec Jacobson 9 년 전
부모
커밋
c9a3b471a9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/igl/slice_mask.cpp

+ 1 - 1
include/igl/slice_mask.cpp

@@ -55,8 +55,8 @@ IGL_INLINE void igl::slice_mask(
     case 1:
     case 1:
     {
     {
       const int ym = R.count();
       const int ym = R.count();
-      Y.resize(ym,X.cols());
       assert(X.rows() == R.size() && "X.rows() should match R.size()");
       assert(X.rows() == R.size() && "X.rows() should match R.size()");
+      Y.resize(ym,X.cols());
       {
       {
         int yi = 0;
         int yi = 0;
         for(int i = 0;i<X.rows();i++)
         for(int i = 0;i<X.rows();i++)