EXT-3973 viewer crash

Rendering cost calculations didn't handle the case of a face having no image
associated with it. Added in null checks before using the pointer to the image.
Crash no longer repros.

Code reviewed by Vir.
master
Nyx (Neal Orman) 2010-01-07 11:36:11 -05:00
parent 2ee8c95763
commit 80db391816
1 changed files with 5 additions and 2 deletions

View File

@ -2689,13 +2689,16 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
const LLTextureEntry* te = face->getTextureEntry();
const LLViewerTexture* img = face->getTexture();
textures.insert(img->getID());
if (img)
{
textures.insert(img->getID());
}
if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
{
alpha++;
}
else if (img->getPrimaryFormat() == GL_ALPHA)
else if (img && img->getPrimaryFormat() == GL_ALPHA)
{
invisi = 1;
}