Skip to content

Commit

Permalink
Fix possible nullptr dereferencing. (assimp#5595)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimkulling authored May 24, 2024
1 parent ec5242a commit 30466aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/Common/Subdivision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ void CatmullClarkSubdivider::InternSubdivide(
}
}

ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces);
if (mp == nullptr) {
continue;
}

ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces);
const aiFace &f = mp->mFaces[adj[o] - moffsets[nidx].first];
bool haveit = false;

Expand Down

0 comments on commit 30466aa

Please sign in to comment.