The current Diligent implementation unconditionally obtains:
Accessor
BufferView
Buffer
and then returns a pointer into the buffer. It does not materialize sparse replacements.
A valid sparse accessor may have no base bufferView; in that case, its base values are defined as zeros and the sparse entries are overlaid on top.
Therefore there are two failure modes:
A sparse accessor with a base buffer view silently ignores all sparse overrides.
A sparse-only accessor has an invalid base buffer-view ID and can enter an invalid lookup path.
This applies to vertex attributes, indices, inverse bind matrices, and animation accessors.
Full-span validation is also missing
Diligent's TinyGLTF buffer wrapper only checks that the starting offset is inside the buffer. It does not verify that the last accessor element fits.
The glTF requirement is effectively:
accessorOffset
+ stride * (count - 1)
+ elementSize
<= bufferViewLength
with corresponding checks against the underlying buffer.
A malformed count or stride can therefore produce an initially valid pointer followed by out-of-bounds reads during bounding-box calculation, hashing, index packing, or vertex packing.
The current Diligent implementation unconditionally obtains:
and then returns a pointer into the buffer. It does not materialize sparse replacements.
A valid sparse accessor may have no base
bufferView; in that case, its base values are defined as zeros and the sparse entries are overlaid on top.Therefore there are two failure modes:
A sparse accessor with a base buffer view silently ignores all sparse overrides.
A sparse-only accessor has an invalid base buffer-view ID and can enter an invalid lookup path.
This applies to vertex attributes, indices, inverse bind matrices, and animation accessors.
Full-span validation is also missing
Diligent's TinyGLTF buffer wrapper only checks that the starting offset is inside the buffer. It does not verify that the last accessor element fits.
The glTF requirement is effectively:
with corresponding checks against the underlying buffer.
A malformed count or stride can therefore produce an initially valid pointer followed by out-of-bounds reads during bounding-box calculation, hashing, index packing, or vertex packing.