assimp / assimp/assimp

[OpenGEX] Crash when attempt load bundled test OpenGEX 3D model files

Open
#6,057 4 comments 0 reactions 0 assignees View on GitHub
Bug Crash OpenGEX
Dominant language
C++
Stars
13.2k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
21

Description

Getting crashes when attempting to load bundled OpenGEX models. Reason appears to be that when iterating in `OpenGEXImporter::resolveReferences()`, this line is failing:
```
node->mMeshes[i] = meshIdx;
```
because `i` greater than or equal to value of `node->mNumMeshes`.

Can easily observe this problem by adding logging around that line in `OpenGEXImporter::resolveReferences()` e.g.
```
if (i < node->mNumMeshes) {
node->mMeshes[i] = meshIdx;
// Log success...
} else {
// Log failure...
}
```

Affected models:

Model
test/models/OpenGEX/animation_example.ogex
test/models/OpenGEX/camera.ogex
test/models/OpenGEX/collada.ogex

Contributor guide

Open the contributing guide

Research direction

Start in OpenGEXImporter::resolveReferences() and reproduce the crash with test/models/OpenGEX/animation_example.ogex, camera.ogex, and collada.ogex. Trace the mesh-reference iteration around node->mMeshes[i] and verify the affected models load without an out-of-bounds access or crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.