فهرست منبع

Viewer crash after calling clear (#1582)

missing check for empty uv similar to line 747
teseoch 5 سال پیش
والد
کامیت
45cfc79fed
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      include/igl/opengl/ViewerData.cpp

+ 1 - 1
include/igl/opengl/ViewerData.cpp

@@ -694,7 +694,7 @@ IGL_INLINE void igl::opengl::ViewerData::updateGL(
           meshgl.F_vbo.row(i) << i*3+0, i*3+1, i*3+2;
           meshgl.F_vbo.row(i) << i*3+0, i*3+1, i*3+2;
       }
       }
 
 
-      if (meshgl.dirty & MeshGL::DIRTY_UV)
+      if ( (meshgl.dirty & MeshGL::DIRTY_UV) && data.V_uv.rows()>0)
       {
       {
         meshgl.V_uv_vbo.resize(data.F.rows()*3,2);
         meshgl.V_uv_vbo.resize(data.F.rows()*3,2);
         for (unsigned i=0; i<data.F.rows();++i)
         for (unsigned i=0; i<data.F.rows();++i)