coverity issues:

CID: 478
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/softbody.c
Function: apply_spring_memory
Description: Pointer "sb" dereferenced before NULL check

and
CID: 480
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/softbody.c
Function: springs_from_particles
Description: Pointer "ob" dereferenced before NULL check

again moved assignment after check to make sure pointer is valid.

Kent
This commit is contained in:
Kent Mein 2009-06-05 04:15:19 +00:00
parent 010a9c0b00
commit c5b05fd450

@ -3075,8 +3075,8 @@ static void apply_spring_memory(Object *ob)
int a;
float b,l,r;
b = sb->plastic;
if (sb && sb->totspring){
b = sb->plastic;
for(a=0; a<sb->totspring; a++) {
bs = &sb->bspring[a];
bp1 =&sb->bpoint[bs->v1];
@ -3546,9 +3546,9 @@ static void springs_from_particles(Object *ob)
int a,k;
float hairmat[4][4];
psys= ob->soft->particles;
sb= ob->soft;
if(ob && sb && psys) {
if(ob && ob->soft && ob->soft->particles) {
psys= ob->soft->particles;
sb= ob->soft;
psmd = psys_get_modifier(ob, psys);
bp= sb->bpoint;