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

Incorrect buffer size check in meshopt_spatialSortRemap function #981

Closed
HamiltonHuaji opened this issue May 23, 2024 · 0 comments
Closed

Comments

@HamiltonHuaji
Copy link

Version

3.3.4 (snapshot)

Platform

Linux x64, Linux arm64, Linux arm32, macOS x64, macOS arm64, Windows x64, Windows x86, Windows arm64

JDK

Not Applicable

Module

Meshopt

Bug description

The meshopt_spatialSortRemap function, as well as potentially other functions in the meshopt module of the lwjgl library has an incorrect buffer size check.
According to the documentation, the destination buffer is expected to have enough space. However, the implementation calculates the vertex_count variable based on the remaining space in the destination buffer and checks the remaining space of vertex_positions buffer.
The correct implementation should calculate vertex_count based on vertex_positions.remaining() and check the remaining space of the destination buffer.

Stacktrace or crash log output

No response

Spasi added a commit to Spasi/lwjgl3 that referenced this issue May 24, 2024
Spasi added a commit to Spasi/lwjgl3 that referenced this issue May 24, 2024
@Spasi Spasi closed this as completed in b72dfaf Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants