diff options
-rwxr-xr-x | .hgtags | 1 | ||||
-rw-r--r-- | indra/newview/lltexturecache.cpp | 15 |
2 files changed, 14 insertions, 2 deletions
@@ -364,3 +364,4 @@ f1d3b3fcab28ed9ea532bf50db0ba96f5c8cc8e9 DRTVWR-232 94ab2b49458ab372a95d2d6949fdf574f413068d 3.4.3-beta1 965b9a35e260c0f53be1a25f0db7abc8a67eaf47 DRTVWR-252 bb10adc4f76cf0067fca7075146f00cdc0740e9d DRTVWR-251 +ab0aa2f6ba22b52fed30a2337197f589156edc75 DRTVWR-253 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); |