Commit 7e7830e
authored
Validate glTF data in
This changelist adds a `cgltf_validate` step to `CgltfLoader`, rejecting invalid glTF files before their contents are used to construct meshes.
The cgltf parser is intentionally permissive, and does not verify that accessor ranges, buffer view extents, and object references are internally consistent. Validating the parsed data after buffer loading guards downstream mesh construction code against out-of-bounds reads when an invalid asset is loaded.
This changelist additionally fixes a memory leak in `CgltfLoader`, where a failure in buffer loading or validation would previously return without freeing the data allocated by `cgltf_parse_file`.CgltfLoader (#2975)1 parent ccaf607 commit 7e7830e
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
153 | 154 | | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
0 commit comments