summaryrefslogtreecommitdiff
path: root/indra/llimage/llimageworker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage/llimageworker.cpp')
-rw-r--r--indra/llimage/llimageworker.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index 553e5cd7bf..587f25dc1b 100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -58,6 +58,7 @@ private:
BOOL mDecodedRaw;
BOOL mDecodedAux;
LLPointer<LLImageDecodeThread::Responder> mResponder;
+ std::string mErrorString;
};
@@ -156,6 +157,7 @@ bool ImageRequest::processRequest()
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
const F32 decode_time_slice = 0.f; //disable time slicing
bool done = true;
+ mErrorString.clear();
if (!mDecodedRaw && mFormattedImage.notNull())
{
// Decode primary channels
@@ -164,10 +166,13 @@ bool ImageRequest::processRequest()
// parse formatted header
if (!mFormattedImage->updateData())
{
+ // Pick up errors from updateData
+ mErrorString = LLImage::getLastThreadError();
return true; // done (failed)
}
if (!(mFormattedImage->getWidth() * mFormattedImage->getHeight() * mFormattedImage->getComponents()))
{
+ mErrorString = "Invalid image size";
return true; // done (failed)
}
if (mDiscardLevel >= 0)
@@ -181,6 +186,9 @@ bool ImageRequest::processRequest()
done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice);
// some decoders are removing data when task is complete and there were errors
mDecodedRaw = done && mDecodedImageRaw->getData();
+
+ // Pick up errors from decoding
+ mErrorString = LLImage::getLastThreadError();
}
if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull())
{
@@ -193,6 +201,9 @@ bool ImageRequest::processRequest()
}
done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4);
mDecodedAux = done && mDecodedImageAux->getData();
+
+ // Pick up errors from decoding
+ mErrorString = LLImage::getLastThreadError();
}
return done;
@@ -204,7 +215,7 @@ void ImageRequest::finishRequest(bool completed)
if (mResponder.notNull())
{
bool success = completed && mDecodedRaw && (!mNeedsAux || mDecodedAux);
- mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux, mRequestId);
+ mResponder->completed(success, mErrorString, mDecodedImageRaw, mDecodedImageAux, mRequestId);
}
// Will automatically be deleted
}