aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorthickbrick2010-10-05 19:51:23 +0200
committerthickbrick2010-10-05 19:51:23 +0200
commitb35201c19ee61841aaea77f41b044bc7f53996a3 (patch)
tree79a51cde2efd07fc9c7b22f51742b12a84d9d997 /linden/indra/newview
parentDon't leak SpellMenuBind structs when destroying LLLineEditor/LLTextEditor ob... (diff)
downloadmeta-impy-b35201c19ee61841aaea77f41b044bc7f53996a3.zip
meta-impy-b35201c19ee61841aaea77f41b044bc7f53996a3.tar.gz
meta-impy-b35201c19ee61841aaea77f41b044bc7f53996a3.tar.bz2
meta-impy-b35201c19ee61841aaea77f41b044bc7f53996a3.tar.xz
Fix RED-603: Errors when loading local images
Avoid bad offsets that would cause failure with this warning: "doRead: Error reading file from local cache"
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/lltexturecache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp
index 46c125f..0c35b32 100644
--- a/linden/indra/newview/lltexturecache.cpp
+++ b/linden/indra/newview/lltexturecache.cpp
@@ -372,9 +372,10 @@ bool LLTextureCacheRemoteWorker::doRead()
372 if (!done && (mState == LOCAL)) 372 if (!done && (mState == LOCAL))
373 { 373 {
374 llassert(local_size != 0); // we're assuming there is a non empty local file here... 374 llassert(local_size != 0); // we're assuming there is a non empty local file here...
375 if (!mDataSize || mDataSize > local_size) 375 llassert(mReadData == NULL);
376 if (!mDataSize || mDataSize > (local_size - mOffset))
376 { 377 {
377 mDataSize = local_size; 378 mDataSize = local_size - mOffset;
378 } 379 }
379 // Allocate read buffer 380 // Allocate read buffer
380 mReadData = new U8[mDataSize]; 381 mReadData = new U8[mDataSize];