coverity issue CID: 44
Checker: FORWARD_NULL (help) File: base/src/source/blender/render/intern/source/texture.c Function: do_lamp_tex Description: Variable "co" tracked as NULL was dereferenced. co was set to NULL at the beginning of the function and it could possibly slip through all the logic above so lets test it before we use it blindly. Kent
This commit is contained in:
@@ -2420,13 +2420,13 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef
|
||||
|
||||
|
||||
/* placement */
|
||||
if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
|
||||
if(mtex->projx && co) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
|
||||
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
|
||||
|
||||
if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
|
||||
if(mtex->projy && co) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
|
||||
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
|
||||
|
||||
if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
|
||||
if(mtex->projz && co) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
|
||||
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
|
||||
|
||||
if(shi->osatex) {
|
||||
|
||||
Reference in New Issue
Block a user