From f1604685162c953c008334eeb6bf9695936f778a Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 21 Nov 2011 07:24:15 +0000 Subject: [PATCH] added some further controls when reading edges in ply --- wrap/io_trimesh/import_ply.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wrap/io_trimesh/import_ply.h b/wrap/io_trimesh/import_ply.h index d2fa634b..69da373a 100644 --- a/wrap/io_trimesh/import_ply.h +++ b/wrap/io_trimesh/import_ply.h @@ -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;