viewer#2153 Crash at LLViewerTextureList::updateImageDecodePriority

Crash at getTextureEntry which calls getTE(mTEOffset)
meow-7.2.2
Andrey Kleshchev 2024-07-31 17:26:27 +03:00 committed by Andrey Kleshchev
parent c3b678276d
commit beb177bb23
1 changed files with 3 additions and 1 deletions

View File

@ -948,7 +948,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
// shows one letter at a time
//
// Maximum usage examples: huge chunk of terrain repeats texture
const LLTextureEntry* te = face->getTextureEntry();
S32 te_offset = face->getTEOffset(); // offset is -1 if not inited
LLViewerObject* objp = face->getViewerObject();
const LLTextureEntry* te = (te_offset < 0 || te_offset >= objp->getNumTEs()) ? nullptr : objp->getTE(te_offset);
F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f;
min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max());
vsize /= min_scale;