Skip to content

Validate glTF data in CgltfLoader#2975

Open
jstone-lucasfilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_cgltf_validation
Open

Validate glTF data in CgltfLoader#2975
jstone-lucasfilm wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_cgltf_validation

Conversation

@jstone-lucasfilm

Copy link
Copy Markdown
Member

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.

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`.
@jstone-lucasfilm jstone-lucasfilm requested a review from kwokcb June 10, 2026 18:55
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.

1 participant