From c28d8d0c0a3faa781297938a36e2c8047bfec7a5 Mon Sep 17 00:00:00 2001 From: Beeks Date: Fri, 10 Sep 2010 20:03:56 -0400 Subject: [PATCH] Possible fix for texture corruption crash loop Signed-off-by: Beeks --- indra/newview/lltexturecache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 1b52a1925..f6ff2e99e 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1062,6 +1062,13 @@ void LLTextureCache::writeEntryAndClose(S32 idx, Entry& entry) if (!mReadOnly) { entry.mTime = time(NULL); + if(entry.mImageSize < entry.mBodySize) + { + // Just say no, due to my messing around to cache discards other than 0 we can end up here + // after recalling an image from cache at a lower discard than cached. RC + return; + } + llassert_always(entry.mImageSize == 0 || entry.mImageSize == -1 || entry.mImageSize > entry.mBodySize); if (entry.mBodySize > 0) {