From 76cd7046bba916737de142a76b06adea9f52660c Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 15:54:39 +0000 Subject: 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 --- source/blender/render/intern/source/texture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d41f68c021a..f2169ceea12 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -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) { -- cgit v1.2.3