summaryrefslogtreecommitdiff
path: root/indra/llkdu
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-12-14 23:25:11 +0100
committerGuru <alexandrgproductengine@lindenlab.com>2023-12-15 07:45:05 +0100
commit7f9438ed2b1e91aff615673ca2d97a3f300910f6 (patch)
tree9581e7645e3af871625d8f84723b8aeaae84f586 /indra/llkdu
parent70b6eaa6e3f462fa3086f57a15ca29a303191693 (diff)
SL-3508 Crash in LLKDUDecodeState::processTileDecode
Diffstat (limited to 'indra/llkdu')
-rw-r--r--indra/llkdu/llimagej2ckdu.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index 2ad42d6b87..eeda08f21e 100644
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -514,6 +514,7 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
ECodeStreamMode mode = MODE_FAST;
+ bool limit_time = decode_time > 0.0f;
LLTimer decode_timer;
if (!mCodeStreamp->exists())
@@ -578,16 +579,18 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
mCodeStreamp.get()));
}
// Do the actual processing
- F32 remaining_time = decode_time - decode_timer.getElapsedTimeF32();
+ F32 remaining_time = limit_time ? decode_time - decode_timer.getElapsedTimeF32() : 0.0f;
// This is where we do the actual decode. If we run out of time, return false.
- if (mDecodeState->processTileDecode(remaining_time, (decode_time > 0.0f)))
+ if (mDecodeState->processTileDecode(remaining_time, limit_time))
{
mDecodeState.reset();
}
else
{
// Not finished decoding yet.
- // setLastError("Ran out of time while decoding");
+ base.setLastError("Ran out of time while decoding");
+ base.decodeFailed();
+ cleanupCodeStream();
return false;
}
}