coverity issue CID: 307
authorKent Mein <mein@cs.umn.edu>
Sat, 13 Jun 2009 22:23:24 +0000 (22:23 +0000)
committerKent Mein <mein@cs.umn.edu>
Sat, 13 Jun 2009 22:23:24 +0000 (22:23 +0000)
Checker: FORWARD_NULL (help)
File: base/src/source/blender/blenkernel/intern/modifier.c
Function: meshdeformModifier_deformVerts
Description: Variable "dm" tracked as NULL was passed to a function that dereferences it.

fix provided by Brecht.

Kent

source/blender/blenkernel/intern/modifier.c

index 2c4528f641ea32175bda00f6bb52e5873a6d4a11..29930b3eb5893017a4738a888fe1f825c27065d6 100644 (file)
@@ -7813,10 +7813,12 @@ static void meshdeformModifier_deformVerts(
 {
        DerivedMesh *dm;
 
-       if(!derivedData && ob->type==OB_MESH)
-               dm= CDDM_from_mesh(ob->data, ob);
-       else
-               dm= derivedData;
+       if (!derivedData) {
+               dm= get_original_dm(ob, NULL, 0);
+               if (dm == NULL) return;
+       }
+       else dm= derivedData;
+
 
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */