From fa4273ee1f069058a9bc151465d10726fc128986 Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Mon, 20 Feb 2023 19:56:57 +0100 Subject: [PATCH] Fix index out of bounds --- code/AssetLib/MS3D/MS3DLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/MS3D/MS3DLoader.cpp b/code/AssetLib/MS3D/MS3DLoader.cpp index 577078158..d4dd2be75 100644 --- a/code/AssetLib/MS3D/MS3DLoader.cpp +++ b/code/AssetLib/MS3D/MS3DLoader.cpp @@ -486,7 +486,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile, for (unsigned int j = 0,n = 0; j < m->mNumFaces; ++j) { aiFace& f = m->mFaces[j]; - if (g.triangles[j]>triangles.size()) { + if (g.triangles[j] >= triangles.size()) { throw DeadlyImportError("MS3D: Encountered invalid triangle index, file is malformed"); } @@ -494,7 +494,7 @@ void MS3DImporter::InternReadFile( const std::string& pFile, f.mIndices = new unsigned int[f.mNumIndices=3]; for (unsigned int k = 0; k < 3; ++k,++n) { - if (t.indices[k]>vertices.size()) { + if (t.indices[k] >= vertices.size()) { throw DeadlyImportError("MS3D: Encountered invalid vertex index, file is malformed"); }