From 1bc876542c108b383bc5c45f6df8e54ff753161f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 14 May 2011 19:38:03 +0200 Subject: [PATCH] Avoid possible crash on opensim. See http://redmine.kokuaviewer.org/issues/582 This happened only on opensim. The fixed was made basically by MichelleZ. It doesn't harm anything, so even though it appears to never happen on Agni and it is unknown what bug is causing it, it make the viewer resilient just-in-case... --- indra/newview/llviewertexture.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b42597092..d1c3a40f2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2681,7 +2681,12 @@ void LLViewerFetchedTexture::setCachedRawImage() { --i ; } - + if (mRawImage->getComponents() == 5) + { + llwarns << "IMP-582: Trying to scale an image (" << mID << ") with 5 components!" << llendl; + mIsRawImageValid = 0; + return; + } mRawImage->scale(w >> i, h >> i) ; } if(mCachedRawImage.notNull())