Fix out-of-bounds write on malformed input

pull/625/head
Turo Lamminen 2015-08-06 16:16:34 +03:00
parent a9a62368f8
commit 128923a262
1 changed files with 3 additions and 0 deletions

View File

@ -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];