From 654ae3af4e7bc28f306416a7a36fe9bf3068ded8 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Wed, 24 Aug 2022 10:42:01 +0300 Subject: [PATCH] Fix out of bounds access in X3D loader --- code/AssetLib/X3D/X3DImporter_Geometry2D.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/AssetLib/X3D/X3DImporter_Geometry2D.cpp b/code/AssetLib/X3D/X3DImporter_Geometry2D.cpp index 8d0f5bad9..d8551de35 100644 --- a/code/AssetLib/X3D/X3DImporter_Geometry2D.cpp +++ b/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; }