Issue found by PVS Studio:

Several instances where we utilize a pointer variable without properly testing that they aren't null first.
This commit is contained in:
Areloch 2015-07-28 23:19:59 -05:00
parent b24bdfbc8b
commit 3a18819e1e
9 changed files with 44 additions and 37 deletions

View file

@ -737,7 +737,7 @@ void PostEffect::_setupConstants( const SceneRenderState *state )
mShaderConsts->set( mMatPrevScreenToWorldSC, tempMat );
}
if ( mAmbientColorSC->isValid() )
if (mAmbientColorSC->isValid() && state)
{
const ColorF &sunlight = state->getAmbientLightColor();
Point3F ambientColor( sunlight.red, sunlight.green, sunlight.blue );