From c2db6a0abdf4e54f09c7821d5e71c1bcd652829d Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 9 Feb 2013 17:35:59 -0500 Subject: [PATCH] Fix array access when loading colored binary STLs Loading binary STLs with colors caused a crash due to writing after the end of the colors array. --- code/STLLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 2c43b8258..b94f22043 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -382,7 +382,7 @@ bool STLImporter::LoadBinaryFile() DefaultLogger::get()->info("STL: Mesh has vertex colors"); } - aiColor4D* clr = &pMesh->mColors[0][pMesh->mNumFaces*3]; + aiColor4D* clr = &pMesh->mColors[0][i*3]; clr->a = 1.0f; if (bIsMaterialise) // fuck, this is reversed {