diff options
| author | Aura Linden <aura@lindenlab.com> | 2013-07-11 17:49:13 -0700 |
|---|---|---|
| committer | Aura Linden <aura@lindenlab.com> | 2013-07-11 17:49:13 -0700 |
| commit | ce9962b33872db65b70c9b10901ec9062cb59169 (patch) | |
| tree | 94be5367128e241ef1c6f802e8551a9b4ed786ff /indra/newview/lltexturecache.cpp | |
| parent | 8642f57dd95864ec6b002f6519701f30866c6502 (diff) | |
| parent | 6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff) | |
Merged in viewer-release
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
| -rwxr-xr-x[-rw-r--r--] | indra/newview/lltexturecache.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 305f6fca0f..36a7aeb590 100644..100755 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -568,8 +568,11 @@ bool LLTextureCacheRemoteWorker::doWrite() idx = mCache->setHeaderCacheEntry(mID, entry, mImageSize, mDataSize); // create the new entry. if(idx >= 0) { - //write to the fast cache. - llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)); + // (almost always) write to the fast cache. + if (mRawImage->getDataSize()) + { + llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)); + } } } else @@ -1895,10 +1898,17 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 discardlevel) { //rescale image if needed + if (raw.isNull() || !raw->getData()) + { + llerrs << "Attempted to write NULL raw image to fastcache" << llendl; + return false; + } + S32 w, h, c; w = raw->getWidth(); h = raw->getHeight(); c = raw->getComponents(); + S32 i = 0 ; while(((w >> i) * (h >> i) * c) > TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) |
