diff options
author | Christian Goetze (CG) <cg@lindenlab.com> | 2010-08-12 12:29:51 -0700 |
---|---|---|
committer | Christian Goetze (CG) <cg@lindenlab.com> | 2010-08-12 12:29:51 -0700 |
commit | 3678a3e6e5f1c2d134d2d9c8c0a3cbc1a8ee11a0 (patch) | |
tree | 50f4e601307683686944ef5a8a2c8d22d88ba7e5 /indra/newview/lltexturefetch.cpp | |
parent | bcd84433717e42ec8675009e1335caf915cc1a41 (diff) | |
parent | 51d460089e83a7f09b52af80c99392d246448b43 (diff) |
Pulled "viewer-hotfix" into "viewer-release".
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 65a40a5b3a..5e087f311c 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -872,10 +872,17 @@ bool LLTextureFetchWorker::doWork(S32 param) cur_size = mFormattedImage->getDataSize(); // amount of data we already have if (mFormattedImage->getDiscardLevel() == 0) { - // We already have all the data, just decode it - mLoadedDiscard = mFormattedImage->getDiscardLevel(); - mState = DECODE_IMAGE; - return false; + if(cur_size > 0) + { + // We already have all the data, just decode it + mLoadedDiscard = mFormattedImage->getDiscardLevel(); + mState = DECODE_IMAGE; + return false; + } + else + { + return true ; //abort. + } } } mRequestedSize = mDesiredSize; @@ -982,6 +989,17 @@ bool LLTextureFetchWorker::doWork(S32 param) } } + llassert_always(mBufferSize == cur_size + mRequestedSize); + if(!mBufferSize)//no data received. + { + delete[] mBuffer; + mBuffer = NULL; + + //abort. + mState = DONE; + return true; + } + if (mFormattedImage.isNull()) { // For now, create formatted image based on extension @@ -992,8 +1010,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mFormattedImage = new LLImageJ2C; // default } } - - llassert_always(mBufferSize == cur_size + mRequestedSize); + if (mHaveAllData && mRequestedDiscard == 0) //the image file is fully loaded. { mFileSize = mBufferSize; @@ -1052,7 +1069,12 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mFormattedImage->getDataSize() <= 0) { - llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl; + //llerrs << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl; + + //abort, don't decode + mState = DONE; + setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); + return true; } if (mLoadedDiscard < 0) { |