Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Malformed GLTF crashes the editor #94696

Closed
pablitar opened this issue Jul 24, 2024 · 2 comments
Closed

[3.x] Malformed GLTF crashes the editor #94696

pablitar opened this issue Jul 24, 2024 · 2 comments

Comments

@pablitar
Copy link

Tested versions

  • Reproducible in 3.5.3, 3.6rc-1
  • NOT reproducible in 4.3-beta3

System information

Windows 10.0.22631 dedicated NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA; 31.0.15.3742) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)

Issue description

Adding the provided GLTF to a project causes the editor to crash. After that, it is not possible to open the project without the editor crashing again.

The GLTF is most likely malformed. Don't know exactly what's wrong with it. It most likely got mangled during a merge, and its bin file and GLTF file are not compatible. Still reporting it as a bug since it happened to us while working "normally" and it's difficult to find out why it's crashing.

It crashes in 3.x. It doesn't crash in 4.3-beta3. Instead it shows the following error in the console:

  Error importing 'res://brokengltf/03_level_RocksMaze.gltf'.
  modules/gltf/gltf_document.cpp:2850 - Index indices_w[idx_i] = 59141 is out of bounds (orig_vertex_num = 8365).
  modules/gltf/gltf_document.cpp:7251 - Condition "err != OK" is true. Returning: ERR_PARSE_ERROR
  modules/gltf/gltf_document.cpp:6895 - Condition "err != OK" is true. Returning: err
  modules/gltf/gltf_document.cpp:7426 - Condition "err != OK" is true. Returning: err
  Error importing 'res://brokengltf/03_level_RocksMaze.gltf'.

Steps to reproduce

  1. Download the minimal reproduction project.
  2. Open it with Godot 3.x

Minimal reproduction project (MRP)

brokengltf3.x.zip

@lawnjelly
Copy link
Member

Yes, looks like the GLTF contains some out of bounds (it's crashing in the vertex optimizer for me in 3.6 RC1 but if it crashes in 3.5.3 too the regular import code is not tolerant either).

We should be able to put some checking for this in 3.x so it aborts with an error and doesn't crash.

@lawnjelly
Copy link
Member

Fixed by #94972 .

@akien-mga akien-mga modified the milestones: 3.x, 3.6 Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants