Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed glb padding issue #62

Merged
merged 3 commits into from
Jul 11, 2022
Merged

Fixed glb padding issue #62

merged 3 commits into from
Jul 11, 2022

Conversation

nithinp7
Copy link
Contributor

@nithinp7 nithinp7 commented Nov 1, 2021

When adding padding to a glb to align to 8-byte boundaries, I don't think the glb's length and the json chunk's length were being properly updated. The new uint32_t byte lengths after padding were being static_cast to a char and put in the left-most byte of the byte length slots within the glb buffer.

@nithinp7 nithinp7 changed the title Fixed padding not properly updating glb and json chunk byte lengths Fixed glb padding issue Nov 1, 2021
@sanjeetsuhag
Copy link

Thanks for the PR @nithinp7. This is an important fix.

The associated spec for this should be updated too, since it clearly did not do enough to cover all cases:

TEST_CASE("Test writing GLBs with JSON chunks padded to 8 bytes", "[Gltf]")

@lilleyse
Copy link
Contributor

I ran into the same problem. Even though the unit test could be improved I'm going to merge just so we get this fix in.

@lilleyse lilleyse merged commit c2caf2a into 3d-tiles-next Jul 11, 2022
@lilleyse lilleyse deleted the glb-padding-fix branch July 11, 2022 19:31
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.

3 participants