diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-12-04 21:13:35 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-12-04 21:13:35 -0500 |
commit | b078a515e197473dbab34724263348dd88030b4d (patch) | |
tree | aa09492fa77e857df11f196a7f0f04efa2a901ca /indra/newview | |
parent | 87b4386ac6c98bca51faff7971e551cbd0676a63 (diff) | |
parent | bb0fd8745b599e9293f2590cb00ceede136d74a0 (diff) |
merge changes for DRTVWR-253
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltexturecache.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index a61e2d5c86..2d463f0afa 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1861,7 +1861,12 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d mFastCachep->seek(APR_SET, offset); - llassert_always(mFastCachep->read(head, TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) == TEXTURE_FAST_CACHE_ENTRY_OVERHEAD); + if(mFastCachep->read(head, TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) != TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) + { + //cache corrupted or under thread race condition + closeFastCache(); + return NULL; + } S32 image_size = head[0] * head[1] * head[2]; if(!image_size) //invalid @@ -1872,7 +1877,13 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d discardlevel = head[3]; data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), image_size); - llassert_always(mFastCachep->read(data, image_size) == image_size); + if(mFastCachep->read(data, image_size) != image_size) + { + FREE_MEM(LLImageBase::getPrivatePool(), data); + closeFastCache(); + return NULL; + } + closeFastCache(); } LLPointer<LLImageRaw> raw = new LLImageRaw(data, head[0], head[1], head[2], true); |