summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-01-21 23:08:00 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-01-22 16:06:30 +0200
commit5af750a1304f795fae4d6e8336defe1eff3f3659 (patch)
treead6680e5b66b9ab83efb296815710ddfa9073128 /indra/newview/llface.cpp
parent831f7d6b7b05414067d24ec43c5b17eb65169a5c (diff)
#3450 Crash at LLViewerMediaTexture::setPlaying
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 3ccb363321..811aacb2ed 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -893,7 +893,7 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, const LLVector4a& po
//VECTORIZE THIS
// see if we have a non-default mapping
- U8 texgen = getTextureEntry()->getTexGen();
+ U8 texgen = tep->getTexGen();
if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{
LLVector4a& center = *(mDrawablep->getVOVolume()->getVolume()->getVolumeFace(mTEOffset).mCenter);
@@ -983,8 +983,17 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs
return false;
}
const LLTextureEntry *orig_tep = align_to->getTextureEntry();
+ if (!orig_tep)
+ {
+ return false;
+ }
+ const LLTextureEntry* tep = getTextureEntry();
+ if (!tep)
+ {
+ return false;
+ }
if ((orig_tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR) ||
- (getTextureEntry()->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR))
+ (tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR))
{
return false;
}
@@ -1563,7 +1572,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
bump_t_primary_light_ray.load3((offset_multiple * t_scale * primary_light_ray).mV);
}
- U8 texgen = getTextureEntry()->getTexGen();
+ const LLTextureEntry* tep = getTextureEntry();
+ U8 texgen = tep ? tep->getTexGen() : LLTextureEntry::TEX_GEN_DEFAULT;
if (rebuild_tcoord && texgen != LLTextureEntry::TEX_GEN_DEFAULT)
{ //planar texgen needs binormals
mVObjp->getVolume()->genTangents(face_index);
@@ -2051,7 +2061,12 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
LLStrider<LLColor4U> emissive;
mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount);
- U8 glow = (U8) llclamp((S32) (getTextureEntry()->getGlow()*255), 0, 255);
+ const LLTextureEntry* tep = getTextureEntry();
+ U8 glow = 0;
+ if (tep)
+ {
+ glow = (U8)llclamp((S32)(tep->getGlow() * 255), 0, 255);
+ }
LLVector4a src;