mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 08:22:30 +02:00
Fix crash for indices out of bounds in GLTF.
Co-Authored-By: hifiexperiments <hifiexperiments@users.noreply.github.com>
This commit is contained in:
parent
fe7f89cc1b
commit
fe0109aa13
1 changed files with 10 additions and 0 deletions
|
@ -1055,6 +1055,11 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
|
||||
int indicesAccessorIdx = primitive.indices;
|
||||
|
||||
if (indicesAccessorIdx > _file.accessors.size()) {
|
||||
qWarning(modelformat) << "Indices accessor index is out of bounds for model " << _url;
|
||||
continue;
|
||||
}
|
||||
|
||||
GLTFAccessor& indicesAccessor = _file.accessors[indicesAccessorIdx];
|
||||
|
||||
// Buffers
|
||||
|
@ -1093,6 +1098,11 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
foreach(auto &key, keys) {
|
||||
int accessorIdx = primitive.attributes.values[key];
|
||||
|
||||
if (accessorIdx > _file.accessors.size()) {
|
||||
qWarning(modelformat) << "Accessor index is out of bounds for model " << _url;
|
||||
continue;
|
||||
}
|
||||
|
||||
GLTFAccessor& accessor = _file.accessors[accessorIdx];
|
||||
|
||||
if (key == "POSITION") {
|
||||
|
|
Loading…
Reference in a new issue