Fix possible nullptr dereferencing. (#5595)

kimkulling/fix_gcc-14_issue-5592
Kim Kulling 2024-05-24 15:36:30 +02:00 committed by GitHub
parent ec5242a1a0
commit 30466aaf16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -524,6 +524,10 @@ void CatmullClarkSubdivider::InternSubdivide(
} }
} }
if (mp == nullptr) {
continue;
}
ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces); ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces);
const aiFace &f = mp->mFaces[adj[o] - moffsets[nidx].first]; const aiFace &f = mp->mFaces[adj[o] - moffsets[nidx].first];
bool haveit = false; bool haveit = false;