MDC-Loader: fix a possible nullptr access.
parent
a872e7d908
commit
a7306abcfe
|
@ -111,9 +111,9 @@ OPTION( INJECT_DEBUG_POSTFIX
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (IOS)
|
IF (IOS)
|
||||||
IF (NOT CMAKE_BUILD_TYPE)
|
IF (NOT CMAKE_BUILD_TYPE)
|
||||||
SET(CMAKE_BUILD_TYPE "Release")
|
SET(CMAKE_BUILD_TYPE "Release")
|
||||||
ENDIF (NOT CMAKE_BUILD_TYPE)
|
ENDIF (NOT CMAKE_BUILD_TYPE)
|
||||||
ENDIF (IOS)
|
ENDIF (IOS)
|
||||||
|
|
||||||
# Use subset of Windows.h
|
# Use subset of Windows.h
|
||||||
|
|
|
@ -434,10 +434,12 @@ void MDCImporter::InternReadFile(
|
||||||
else if (1 == pScene->mNumMeshes)
|
else if (1 == pScene->mNumMeshes)
|
||||||
{
|
{
|
||||||
pScene->mRootNode = new aiNode();
|
pScene->mRootNode = new aiNode();
|
||||||
pScene->mRootNode->mName = pScene->mMeshes[0]->mName;
|
if ( nullptr != pScene->mMeshes[0] ) {
|
||||||
pScene->mRootNode->mNumMeshes = 1;
|
pScene->mRootNode->mName = pScene->mMeshes[0]->mName;
|
||||||
pScene->mRootNode->mMeshes = new unsigned int[1];
|
pScene->mRootNode->mNumMeshes = 1;
|
||||||
pScene->mRootNode->mMeshes[0] = 0;
|
pScene->mRootNode->mMeshes = new unsigned int[1];
|
||||||
|
pScene->mRootNode->mMeshes[0] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue