summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-10-23 17:15:00 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-10-23 17:15:00 +0300
commit7697f7f9a651766cd7b3e88824dd546e66e3499b (patch)
tree5066107a1a1d7f73b5f2413493d83e28d740070d
parent628e28639d4c92cd9e70d4441ec737d9538eaeec (diff)
MAINT-7929 Viewer shouldn't attempt to access unreadable cache indefientely
-rw-r--r--indra/newview/lltexturecache.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 71d3731f93..7c88cdaf9f 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -936,7 +936,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id)
//////////////////////////////////////////////////////////////////////////////
//static
-F32 LLTextureCache::sHeaderCacheVersion = 1.7f;
+F32 LLTextureCache::sHeaderCacheVersion = 1.71f;
U32 LLTextureCache::sCacheMaxEntries = 1024 * 1024; //~1 million textures.
S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit
std::string LLTextureCache::sHeaderCacheEncoderVersion = LLImageJ2C::getEngineInfo();
@@ -1898,6 +1898,9 @@ S32 LLTextureCache::setHeaderCacheEntry(const LLUUID& id, Entry& entry, S32 imag
else
{
LL_WARNS() << "Failed to set cache entry for image: " << id << LL_ENDL;
+ // We couldn't write to file, switch to read only mode and clear data
+ setReadOnly(true);
+ clearCorruptedCache(); // won't remove files due to "read only"
}
return idx;
@@ -2050,7 +2053,7 @@ 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())
+ if (raw.isNull() || raw->isBufferInvalid() || !raw->getData())
{
LL_ERRS() << "Attempted to write NULL raw image to fastcache" << LL_ENDL;
return false;