This commit fixes the following two coverity issues:

CID: 475
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/cloth.c
Function: bvhselftree_build_from_cloth
Description: Pointer "clmd" dereferenced before NULL check

CID: 476
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/cloth.c
Function: bvhtree_build_from_cloth
Description: Pointer "clmd" dereferenced before NULL check

You'll notice in the code the var is actually set again
a few lines down before being used so better to set it
after you've made sure the pointer is valid.

Kent
This commit is contained in:
Kent Mein 2009-06-02 19:29:20 +00:00
parent 62abe788c4
commit a9c29cd415

@ -157,7 +157,7 @@ BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon)
{
unsigned int i;
BVHTree *bvhtree;
Cloth *cloth = clmd->clothObject;
Cloth *cloth;
ClothVertex *verts;
MFace *mfaces;
float co[12];
@ -198,7 +198,7 @@ BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon)
{
unsigned int i;
BVHTree *bvhtree;
Cloth *cloth = clmd->clothObject;
Cloth *cloth;
ClothVertex *verts;
MFace *mfaces;
float co[12];