summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
{