From a86609af8e2c057307fa59a1e73c0ba0866580aa Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 5 Aug 2008 21:20:14 +0000 Subject: 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. --- source/gameengine/Converter/KX_IpoConvert.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Converter/KX_IpoConvert.cpp') 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); + } } } } -- cgit v1.2.3