Skip to content

Fix index out of bounds panic in glTF animation export - #75

Open
null-port wants to merge 1 commit into
scurest:masterfrom
null-port:fix-gltf-object-curves-oob
Open

Fix index out of bounds panic in glTF animation export#75
null-port wants to merge 1 commit into
scurest:masterfrom
null-port:fix-gltf-object-curves-oob

Conversation

@null-port

Copy link
Copy Markdown

Summary

  • Fix panic in src/convert/gltf/mod.rs when a skeleton references more objects than an animation has curves for
  • The COLLADA exporter already handles this case with .get() + fallback; this applies the same bounds-checking approach to the glTF exporter

Test plan

  • Verified fix compiles without errors
  • Verified convert -f glb --all-animations --more-textures completes successfully on a ROM that previously panicked (440 GLBs written vs crash)

🤖 Generated with Claude Code

Use bounds-checked .get() instead of direct indexing when accessing
object_curves, matching the approach already used by the COLLADA exporter.
Skips animation export for objects whose index exceeds the animation's
curve count rather than panicking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@null-port
null-port marked this pull request as ready for review April 7, 2026 03:57
@scurest

scurest commented Apr 16, 2026

Copy link
Copy Markdown
Owner

What game did you test with?

@null-port

Copy link
Copy Markdown
Author

I tested with Nintendogs - Lab & Friends (USA)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants