Browse Source

IFC: fix possible use after free access bug.

Kim Kulling 9 years ago
parent
commit
e51b7d2a61
1 changed files with 4 additions and 4 deletions
  1. 4 4
      code/IFCOpenings.cpp

+ 4 - 4
code/IFCOpenings.cpp

@@ -715,14 +715,14 @@ void FindAdjacentContours(ContourVector::iterator current, const ContourVector&
             const Contour& mcontour = (*it).contour;
             const Contour& mcontour = (*it).contour;
 
 
             for (size_t n = 0; n < ncontour.size(); ++n) {
             for (size_t n = 0; n < ncontour.size(); ++n) {
-                const IfcVector2& n0 = ncontour[n];
-                const IfcVector2& n1 = ncontour[(n+1) % ncontour.size()];
+                const IfcVector2 n0 = ncontour[n];
+                const IfcVector2 n1 = ncontour[(n+1) % ncontour.size()];
 
 
                 for (size_t m = 0, mend = (is_me ? n : mcontour.size()); m < mend; ++m) {
                 for (size_t m = 0, mend = (is_me ? n : mcontour.size()); m < mend; ++m) {
                     ai_assert(&mcontour != &ncontour || m < n);
                     ai_assert(&mcontour != &ncontour || m < n);
 
 
-                    const IfcVector2& m0 = mcontour[m];
-                    const IfcVector2& m1 = mcontour[(m+1) % mcontour.size()];
+                    const IfcVector2 m0 = mcontour[m];
+                    const IfcVector2 m1 = mcontour[(m+1) % mcontour.size()];
 
 
                     IfcVector2 isect0, isect1;
                     IfcVector2 isect0, isect1;
                     if (IntersectingLineSegments(n0,n1, m0, m1, isect0, isect1)) {
                     if (IntersectingLineSegments(n0,n1, m0, m1, isect0, isect1)) {