From e2f234707a18cb72530970288ef570a7dafcccac Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sun, 12 Apr 2015 19:53:24 +0200 Subject: [PATCH] Fix possible crash in SceneCombiner when the destinations scene has mPrivate==null. Fixes #401. --- code/SceneCombiner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index f9face9b1..26ed94712 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -1023,7 +1023,9 @@ void SceneCombiner::CopyScene(aiScene** _dest,const aiScene* src,bool allocate) dest->mFlags = src->mFlags; // source private data might be NULL if the scene is user-allocated (i.e. for use with the export API) - ScenePriv(dest)->mPPStepsApplied = ScenePriv(src) ? ScenePriv(src)->mPPStepsApplied : 0; + if (dest->mPrivate != NULL) { + ScenePriv(dest)->mPPStepsApplied = ScenePriv(src) ? ScenePriv(src)->mPPStepsApplied : 0; + } } // ------------------------------------------------------------------------------------------------