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

Fix Bad-cast to Assimp::D3DS::Material from invalid vptr in Assimp::ASE::Parser::ParseLV2MaterialBlock #5127

Merged
merged 2 commits into from Jun 27, 2023

Conversation

sashashura
Copy link
Contributor

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47171
Closes #4694

The root cause is that iMaterialCount from ParseLV4MeshLong(iMaterialCount); is very large and m_vMaterials.resize(iOldMaterialCount + iMaterialCount, ...) overflows the integer. Instead of increasing the size of m_vMaterials, the vector is resized to a small number of elements. Later Material &sMat = m_vMaterials[iIndex + iOldMaterialCount]; takes a reference to a non-existing element of the vector (out of bounds vector read).

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@kimkulling kimkulling merged commit d2411a7 into assimp:master Jun 27, 2023
11 checks passed
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

@kimkulling kimkulling added the Bug Global flag to mark a deviation from expected behaviour label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
2 participants