mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 12:12:39 +02:00
Check for out-of-bounds in GLTFSerializer
This commit is contained in:
parent
081ae901d2
commit
351530055f
1 changed files with 5 additions and 0 deletions
|
@ -317,6 +317,11 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
size_t matrixIndex = jointNodeIndex;
|
||||
std::vector<float>& value = inverseBindValues[s];
|
||||
size_t matrixCount = 16 * matrixIndex;
|
||||
if (matrixCount + 15 >= value.size()) {
|
||||
qDebug(modelformat) << "GLTFSerializer::buildGeometry: not enough entries in jointInverseBindTransforms: " << _url;
|
||||
hfmModel.loadErrorCount++;
|
||||
return false;
|
||||
}
|
||||
jointInverseBindTransforms[jointIndex] =
|
||||
glm::mat4(value[matrixCount], value[matrixCount + 1], value[matrixCount + 2], value[matrixCount + 3],
|
||||
value[matrixCount + 4], value[matrixCount + 5], value[matrixCount + 6], value[matrixCount + 7],
|
||||
|
|
Loading…
Reference in a new issue