Skip to content

fix: bounds check for gltf indices#34

Open
anzzyspeaksgit wants to merge 1 commit into
SolarLune:mainfrom
anzzyspeaksgit:fix/issue-19
Open

fix: bounds check for gltf indices#34
anzzyspeaksgit wants to merge 1 commit into
SolarLune:mainfrom
anzzyspeaksgit:fix/issue-19

Conversation

@anzzyspeaksgit

Copy link
Copy Markdown

Closes #19

Added a bounds check for indices read from GLTF files. Previously, if a GLTF file contained primitive indices pointing outside the bound of the vertex attributes array (for example, if interleaved data generated by qmuntal/gltf was improperly exported as described in #19), it would panic with index out of range.

Now, it properly returns an error invalid gltf: index <x> out of bounds for vertex data length <y> instead of panicking.

This prevents panic: index out of range when a GLTF file contains primitive indices pointing outside the bound of vertex attributes array.
@SolarLune

Copy link
Copy Markdown
Owner

Oh, hey, thanks a lot - I appreciate the PR! But I think the line endings or formatting are different or something, because the diff shows complete deletion of the contents of gltf.go followed by the entire file again - do you think you can resubmit with just the changes around the bounds check?

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.

panic: runtime error: index out of range [2] with length 2

2 participants