[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20584] trunk/blender/source/blender/ blenkernel/intern/cloth.c: This commit fixes the following two coverity issues:

Kent Mein mein at cs.umn.edu
Tue Jun 2 21:29:20 CEST 2009


Revision: 20584
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20584
Author:   sirdude
Date:     2009-06-02 21:29:20 +0200 (Tue, 02 Jun 2009)

Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/cloth.c

Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c	2009-06-02 18:10:06 UTC (rev 20583)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c	2009-06-02 19:29:20 UTC (rev 20584)
@@ -157,7 +157,7 @@
 {
 	unsigned int i;
 	BVHTree *bvhtree;
-	Cloth *cloth = clmd->clothObject;
+	Cloth *cloth;
 	ClothVertex *verts;
 	MFace *mfaces;
 	float co[12];
@@ -198,7 +198,7 @@
 {
 	unsigned int i;
 	BVHTree *bvhtree;
-	Cloth *cloth = clmd->clothObject;
+	Cloth *cloth;
 	ClothVertex *verts;
 	MFace *mfaces;
 	float co[12];





More information about the Bf-blender-cvs mailing list