fixed a bug in the STLReader where normals could be set for invalid face handles
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@963 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -323,7 +323,7 @@ read_stla(std::istream& _in, BaseImporter& _bi, Options& _opt) const
|
||||
// set the normal if requested
|
||||
// if a normal was requested but could not be found we unset the option
|
||||
if (facet_normal) {
|
||||
if (_opt.face_has_normal())
|
||||
if (fh.is_valid() && _opt.face_has_normal())
|
||||
_bi.set_normal(fh, n);
|
||||
} else
|
||||
_opt -= Options::FaceNormal;
|
||||
@@ -432,7 +432,7 @@ read_stlb(std::istream& _in, BaseImporter& _bi, Options& _opt) const
|
||||
(vhandles[1] != vhandles[2])) {
|
||||
FaceHandle fh = _bi.add_face(vhandles);
|
||||
|
||||
if (_opt.face_has_normal())
|
||||
if (fh.is_valid() && _opt.face_has_normal())
|
||||
_bi.set_normal(fh, n);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user