Fix possible nullptr dereferencing. (#5595)

This commit is contained in:
Kim Kulling
2024-05-24 15:36:30 +02:00
committed by GitHub
parent ec5242a1a0
commit 30466aaf16

View File

@@ -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;