added some further controls when reading edges in ply

This commit is contained in:
Paolo Cignoni 2011-11-21 07:24:15 +00:00
parent d714bc124c
commit f160468516
1 changed files with 5 additions and 0 deletions

View File

@ -709,6 +709,11 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
pi.status = PlyInfo::E_SHORTFILE;
return pi.status;
}
if( ea.v1<0 || ea.v2<0 || ea.v1>=m.en || ea.v2>=m.en)
{
pi.status = PlyInfo::E_BAD_VERT_INDEX;
return pi.status;
}
(*ei).V(0) = index[ ea.v1 ];
(*ei).V(1) = index[ ea.v2 ];
++ei;