SL-3508 Crash in LLKDUDecodeState::processTileDecode
parent
70b6eaa6e3
commit
7f9438ed2b
|
|
@ -2130,6 +2130,10 @@ U8* LLImageFormatted::reallocateData(S32 size)
|
|||
// virtual
|
||||
void LLImageFormatted::deleteData()
|
||||
{
|
||||
if (mDecoding)
|
||||
{
|
||||
LL_ERRS() << "LLImageFormatted::deleteData() is called during decoding" << LL_ENDL;
|
||||
}
|
||||
sGlobalFormattedMemory -= getDataSize();
|
||||
LLImageBase::deleteData();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,10 +157,10 @@ bool LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir
|
|||
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
|
||||
LLTimer elapsed;
|
||||
|
||||
bool res = true;
|
||||
|
||||
resetLastError();
|
||||
mDecoding = true;
|
||||
|
||||
bool res;
|
||||
// Check to make sure that this instance has been initialized with data
|
||||
if (!getData() || (getDataSize() < 16))
|
||||
{
|
||||
|
|
@ -171,7 +171,6 @@ bool LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir
|
|||
{
|
||||
// Update the raw discard level
|
||||
updateRawDiscardLevel();
|
||||
mDecoding = true;
|
||||
res = mImpl->decodeImpl(*this, *raw_imagep, decode_time, first_channel, max_channel_count);
|
||||
}
|
||||
|
||||
|
|
@ -181,12 +180,21 @@ bool LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir
|
|||
{
|
||||
// Failed
|
||||
raw_imagep->deleteData();
|
||||
res = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mDecoding = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mDecoding)
|
||||
{
|
||||
LL_WARNS() << "decodeImpl failed but mDecoding is TRUE" << LL_ENDL;
|
||||
mDecoding = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mLastError.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue