jkuhlmann / cgltf

:diamond_shape_with_a_dot_inside: Single-file glTF 2.0 loader and writer written in C99
MIT License
1.42k stars 135 forks source link

Improve mesh accessor validation #234

Closed zeux closed 8 months ago

zeux commented 9 months ago

This change attempts to flag more invalid glTF files as invalid when this likely interferes with the mesh processing by causing crashes.

zeux commented 9 months ago

This is easier to review with ignored whitespace in the diff. Also note that I am discovering these as I go; we previously never asked the question, can you meaningfully use various cgltf accessor functions on the result of cgltf_parse, and these changes are attempting to answer that :) I expect there will be a few more PRs in the coming days that fix corner cases like this.