Skip to content

Fix assert on meshes on byte_stride = 0#205

Merged
alteous merged 2 commits intogltf-rs:masterfrom
EmbarkStudios:byte-stride-fix
Feb 28, 2019
Merged

Fix assert on meshes on byte_stride = 0#205
alteous merged 2 commits intogltf-rs:masterfrom
EmbarkStudios:byte-stride-fix

Conversation

@repi
Copy link
Copy Markdown
Contributor

@repi repi commented Feb 24, 2019

Have found glTF meshes (on Google Poly) that specify 0 byte stride for index buffers which caused debug_assert to be triggered on 0 byte stride when calling read_indices.

This should already fail validation, but only the case of validation_completely which is typically not run.

With this change we specifically handle the case of byte stride 0 and treat it as if no byte stride was specified to avoid the debug assert and panicking.

repi added 2 commits February 24, 2019 15:37
Have found glTF meshes (on Google Poly) that specify 0 byte stride for index buffers causing debug_assert to be triggered on 0 byte stride.

This should already fail validation, but only the case of validation_completely which is typically not run.

With this change we specifically handle the case of byte stride 0 and treat it as if no byte stride was specified to avoid the debug assert and panicking.
@alteous alteous merged commit 4e68a75 into gltf-rs:master Feb 28, 2019
@alteous
Copy link
Copy Markdown
Member

alteous commented Feb 28, 2019

Thanks!

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