summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-05-09 10:58:43 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-05-09 10:58:43 -0400
commit8528a9ae131dff09865eccd672efce621571c5e5 (patch)
tree32ce42d00bae4d1ad33d7e1d77fde2f74c58d367 /indra
parented9653f711ace4bd830b36cebcaaf61a97914bbb (diff)
MAINT-7343 - improved error case handling and checking for unlikely corners
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lltexturefetch.cpp11
-rw-r--r--indra/newview/llviewerassetstorage.cpp7
2 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 7245a70962..b78d0b51d5 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1426,11 +1426,15 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
// Capture some measure of total size for metrics
F64 byte_count = 0;
- for (S32 i=mFirstPacket; i<=mLastPacket; i++)
+ if (mLastPacket >= mFirstPacket)
{
- if (mPackets[i])
+ for (S32 i=mFirstPacket; i<=mLastPacket; i++)
{
- byte_count += mPackets[i]->mSize;
+ llassert_always((i>=0) && (i<mPackets.size()));
+ if (mPackets[i])
+ {
+ byte_count += mPackets[i]->mSize;
+ }
}
}
@@ -2231,6 +2235,7 @@ bool LLTextureFetchWorker::processSimulatorPackets()
S32 buffer_size = mFormattedImage->getDataSize();
for (S32 i = mFirstPacket; i<=mLastPacket; i++)
{
+ llassert_always((i>=0) && (i<mPackets.size()));
llassert_always(mPackets[i]);
buffer_size += mPackets[i]->mSize;
}
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index b9bdc4c06f..e0b64403ef 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -532,13 +532,16 @@ void LLViewerAssetStorage::assetRequestCoro(
result_code = LL_ERR_ASSET_REQUEST_FAILED;
ext_status = LL_EXSTAT_VFS_CORRUPT;
}
- if (!vf.rename(uuid, atype))
+ else if (!vf.rename(uuid, atype))
{
LL_WARNS("ViewerAsset") << "rename failed" << LL_ENDL;
result_code = LL_ERR_ASSET_REQUEST_FAILED;
ext_status = LL_EXSTAT_VFS_CORRUPT;
}
- mCountSucceeded++;
+ else
+ {
+ mCountSucceeded++;
+ }
}
else
{