Fix crash in DXBCFile processing if array is last binding. Closes #919

This commit is contained in:
Baldur Karlsson
2018-03-15 13:01:22 +00:00
parent ef12358ceb
commit 3ded6e590a
@@ -699,6 +699,10 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
// remove the array item, and get the iterator to the next item to process
it = resArray.erase(it);
// if we're now pointing at the end of the vector, save that, as the iterator will be
// invalid after we push back below.
bool last = (it == resArray.end());
string rname = desc.name;
uint32_t arraySize = desc.bindCount;
@@ -711,6 +715,10 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
desc.reg++;
}
// if we just expanded the last item, break out of the loop
if(last)
break;
continue;
}