diff options
author | Ton Roosendaal <ton@blender.org> | 2004-04-27 23:30:16 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-04-27 23:30:16 +0400 |
commit | ef4a6c3551a6c23080befea92ef52baa1cf48e8f (patch) | |
tree | d6279b71ffe82af70d2df6f7848ff2aa4b392f6b | |
parent | 978ba3c20802088dcd8049c074e2dd917435a420 (diff) |
Bug 1199
Joining meshes could crash when 1 had vertexgroups, other not.
The first then should have been appended from other file, to make
it more complex. :)
Crash caused by reading NULL pointer.
-rw-r--r-- | source/blender/src/editmesh.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 8c403571eac..f52e1332011 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -7160,12 +7160,13 @@ void join_mesh(void) for (j=0; j<dvert[i].totweight; j++){ // Find the old vertex group odg = BLI_findlink (&base->object->defbase, dvert[i].dw[j].def_nr); - - // Search for a match in the new object - for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){ - if (!strcmp(dg->name, odg->name)){ - dvert[i].dw[j].def_nr = index; - break; + if(odg) { + // Search for a match in the new object + for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){ + if (!strcmp(dg->name, odg->name)){ + dvert[i].dw[j].def_nr = index; + break; + } } } } |