- Launch viewer and log in
- Move to your avatar to a place on the edge of the region where you get a good view of the nearby region
- Open the Pref panel, go to the Graphic tab, click Advanced, increase the Draw Distance (from 64 to 128 for instance)
- Click OK
-> the view crash while redrawing the nearby stuff that are now coming into view
Expected: no crash...
Reason: the code reaches llassert(mCurrentDiscardLevel >= 0) and crashes, the invalid texture should be tested upstream and handled adequately I think.
Issue: When changing the draw distance, LLViewerWindow::restartDisplay() is called which, eventually, calls restoreGL() which iterates on all textures. Here's the code:
for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
iter != sImageList.end(); iter++)
LLImageGL* glimage = *iter;
if (glimage->getComponents() && glimage->mSaveData->getComponents())
glimage->mSaveData = NULL; // deletes data
The problem is that some of the textures are not valid and have an mCurrentDiscardLevel == -1. When createGLTexture() is called on the first of those textures, this leads to the assert and, as expected, crashes the app.