diff --git a/code/LWOLoader.cpp b/code/LWOLoader.cpp index 5ec073507..8de88055b 100644 --- a/code/LWOLoader.cpp +++ b/code/LWOLoader.cpp @@ -954,6 +954,9 @@ inline void LWOImporter::DoRecursiveVMAPAssignment(VMapEntry* base, unsigned int LWO::ReferrerList& refList = mCurLayer->mPointReferrers; unsigned int i; + if (idx >= base->abAssigned.size()) { + throw DeadlyImportError("Bad index"); + } base->abAssigned[idx] = true; for (i = 0; i < numRead;++i) { base->rawData[idx*base->dims+i]= data[i];