diff options
author | Diego Borghetti <bdiego@gmail.com> | 2008-08-06 01:20:14 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2008-08-06 01:20:14 +0400 |
commit | a86609af8e2c057307fa59a1e73c0ba0866580aa (patch) | |
tree | 6d7c4767762c92971f2748d67811eb3a570897b4 /source/gameengine/Converter/KX_IpoConvert.cpp | |
parent | 553694b614be5d20d8be77bea93149ae69da39b9 (diff) |
Fix segmentation faul in GE.
We assign the material name before check the pointer.
Please Benoit check this and also I have a compiler warning
about the second argument in the previous call of
ConvertMaterialIpos, the argument is NULL but the function
need a dword.
Diffstat (limited to 'source/gameengine/Converter/KX_IpoConvert.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_IpoConvert.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 7410beecaf4..61b095d93b1 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -773,8 +773,11 @@ void BL_ConvertMaterialIpos( for (int material_index=1; material_index <= blenderobject->totcol; material_index++) { Material *mat = give_current_material(blenderobject, material_index); - STR_HashedString matname = mat->id.name; - if(mat) ConvertMaterialIpos(mat, matname.hash(), gameobj, converter); + STR_HashedString matname; + if(mat) { + matname= mat->id.name; + ConvertMaterialIpos(mat, matname.hash(), gameobj, converter); + } } } } |