浏览代码

Fix out of bounds access in X3D loader

Turo Lamminen 3 年之前
父节点
当前提交
654ae3af4e
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      code/AssetLib/X3D/X3DImporter_Geometry2D.cpp

+ 4 - 4
code/AssetLib/X3D/X3DImporter_Geometry2D.cpp

@@ -274,10 +274,10 @@ void X3DImporter::readDisk2D(XmlNode &node) {
             }
 
             // add last quad
-            vlist.push_back(*tlist_i.end()); // 1st point
-            vlist.push_back(*tlist_o.end()); // 2nd point
-            vlist.push_back(*tlist_o.begin()); // 3rd point
-            vlist.push_back(*tlist_o.begin()); // 4th point
+            vlist.push_back(tlist_i.back()); // 1st point
+            vlist.push_back(tlist_o.back()); // 2nd point
+            vlist.push_back(tlist_o.front()); // 3rd point
+            vlist.push_back(tlist_o.front()); // 4th point
 
             ((X3DNodeElementGeometry2D *)ne)->NumIndices = 4;
         }