MAINT-8574 Fixed Crash in LLVOVolume::markDead()

Mon, 23 Apr 2018 23:31:23 +0300

author
AndreyL ProductEngine <alihatskiy@productengine.com>
date
Mon, 23 Apr 2018 23:31:23 +0300
changeset 55372
2ea2375b914f
parent 55371
43fee2e6c553
child 55373
7b6b020fd5ad

MAINT-8574 Fixed Crash in LLVOVolume::markDead()
+ null checks in LLVOVolume::setLightTextureID()

indra/newview/llvovolume.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llvovolume.cpp	Mon Apr 23 16:21:20 2018 -0700
     1.2 +++ b/indra/newview/llvovolume.cpp	Mon Apr 23 23:31:23 2018 +0300
     1.3 @@ -266,9 +266,10 @@
     1.4  		{
     1.5  			mSculptTexture->removeVolume(LLRender::SCULPT_TEX, this);
     1.6  		}
     1.7 -		if (hasLightTexture())
     1.8 -		{
     1.9 -			getLightTexture()->removeVolume(LLRender::LIGHT_TEX, this);
    1.10 +
    1.11 +		if (mLightTexture.notNull())
    1.12 +		{
    1.13 +			mLightTexture->removeVolume(LLRender::LIGHT_TEX, this);
    1.14  		}
    1.15  	}
    1.16  	
    1.17 @@ -2850,8 +2851,8 @@
    1.18  		{
    1.19  			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true);
    1.20  		}
    1.21 -		else
    1.22 -		{
    1.23 +		else if (old_texturep)
    1.24 +		{	
    1.25  			old_texturep->removeVolume(LLRender::LIGHT_TEX, this);
    1.26  		}
    1.27  		LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
    1.28 @@ -2860,17 +2861,25 @@
    1.29  			param_block->setLightTexture(id);
    1.30  			parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
    1.31  		}
    1.32 -		getLightTexture()->addVolume(LLRender::LIGHT_TEX, this); // new texture
    1.33 -	}
    1.34 -	else
    1.35 -	{
    1.36 -		if (hasLightTexture())
    1.37 +		LLViewerTexture* tex = getLightTexture();
    1.38 +		if (tex)
    1.39 +		{
    1.40 +			tex->addVolume(LLRender::LIGHT_TEX, this); // new texture
    1.41 +		}
    1.42 +		else
    1.43 +		{
    1.44 +			LL_WARNS() << "Can't get light texture for ID " << id.asString() << LL_ENDL;
    1.45 +		}
    1.46 +	}
    1.47 +	else if (hasLightTexture())
    1.48 +	{
    1.49 +		if (old_texturep)
    1.50  		{
    1.51  			old_texturep->removeVolume(LLRender::LIGHT_TEX, this);
    1.52 -			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true);
    1.53 -			parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
    1.54 -			mLightTexture = NULL;
    1.55 -		}
    1.56 +		}
    1.57 +		setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true);
    1.58 +		parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
    1.59 +		mLightTexture = NULL;
    1.60  	}		
    1.61  }
    1.62  

mercurial