diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-05-09 10:58:43 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-05-09 10:58:43 -0400 |
commit | 8528a9ae131dff09865eccd672efce621571c5e5 (patch) | |
tree | 32ce42d00bae4d1ad33d7e1d77fde2f74c58d367 /indra/newview/lltexturefetch.cpp | |
parent | ed9653f711ace4bd830b36cebcaaf61a97914bbb (diff) |
MAINT-7343 - improved error case handling and checking for unlikely corners
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 11 |
1 files changed, 8 insertions, 3 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; } |