summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-05-25 23:59:33 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-05-25 23:59:56 +0300
commit2938b8238c4c937b18faf2595532cb60a4071712 (patch)
tree292446ebcd000c54182ab3df7010c325667f48ae /indra/newview/lltexturecache.cpp
parent7faec04ea6b1f2c3184de8c10c6da85ceb57a181 (diff)
SL-12889 Failed to cache image crashes
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-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 2e52414d71..6211d0ce3b 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -616,6 +616,9 @@ bool LLTextureCacheRemoteWorker::doWrite()
if(idx >= 0)
{
// write to the fast cache.
+ // mRawImage is not entirely safe here since it is a pointer to one owned by cache worker,
+ // it could have been retrieved via getRequestFinished() and then modified.
+ // If writeToFastCache crashes, something is wrong around fetch worker.
if(!mCache->writeToFastCache(mID, idx, mRawImage, mRawDiscardLevel))
{
LL_WARNS() << "writeToFastCache failed" << LL_ENDL;
@@ -2155,8 +2158,8 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer<LLImage
h >>= i;
if(w * h *c > 0) //valid
{
- //make a duplicate to keep the original raw image untouched.
-
+ // Make a duplicate to keep the original raw image untouched.
+ // Might be good idea to do a copy during writeToCache() call instead of here
try
{
#if LL_WINDOWS