MDC-Loader: fix a possible nullptr access.
parent
a872e7d908
commit
a7306abcfe
|
@ -434,11 +434,13 @@ void MDCImporter::InternReadFile(
|
|||
else if (1 == pScene->mNumMeshes)
|
||||
{
|
||||
pScene->mRootNode = new aiNode();
|
||||
if ( nullptr != pScene->mMeshes[0] ) {
|
||||
pScene->mRootNode->mName = pScene->mMeshes[0]->mName;
|
||||
pScene->mRootNode->mNumMeshes = 1;
|
||||
pScene->mRootNode->mMeshes = new unsigned int[1];
|
||||
pScene->mRootNode->mMeshes[0] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pScene->mRootNode = new aiNode();
|
||||
|
|
Loading…
Reference in New Issue