diff options
author | Ton Roosendaal <ton@blender.org> | 2007-11-14 19:20:19 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-11-14 19:20:19 +0300 |
commit | fa8032ce3180ec0fc4346c8d08e427d1c1b1cfdc (patch) | |
tree | af6ef900ac0ebb8e06c549cdda20bdf745ffb3e1 | |
parent | 0ca299439c705f6b692b038069c227ad8d16688f (diff) |
Bugfix in MeshDeform file reading, should check for NULL pointer case...
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3cb615bb74b..75c746f7213 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2901,12 +2901,15 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) { int a; - for(a=0; a<mmd->totcagevert*mmd->totvert; a++) - SWITCH_INT(mmd->bindweights[a]) - for(a=0; a<mmd->totcagevert*3; a++) - SWITCH_INT(mmd->bindcos[a]) - for(a=0; a<mmd->totvert; a++) - SWITCH_INT(mmd->dynverts[a]) + if(mmd->bindweights) + for(a=0; a<mmd->totcagevert*mmd->totvert; a++) + SWITCH_INT(mmd->bindweights[a]) + if(mmd->bindcos) + for(a=0; a<mmd->totcagevert*3; a++) + SWITCH_INT(mmd->bindcos[a]) + if(mmd->dynverts) + for(a=0; a<mmd->totvert; a++) + SWITCH_INT(mmd->dynverts[a]) } } } |