summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-03-12 00:18:29 -0400
committerGitHub <noreply@github.com>2026-03-12 00:18:29 -0400
commit18db816ef7552785ffa26d6d0397efbb341a999f (patch)
tree9c289d5f63d0f52783520c0100c74fd4fb756549 /indra/llimage
parentbf347d15804c27348c84a55ab763f89b718e8aac (diff)
parente572093ef7e0ed4c9d94be4ecaae850bcdb73e54 (diff)
Merge pull request #5097 from secondlife/release/2026.01
2026.01
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimage.cpp16
-rw-r--r--indra/llimage/llimageworker.cpp2
2 files changed, 15 insertions, 3 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index ca8a4199e8..35bc7065b1 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -709,8 +709,20 @@ U8* LLImageBase::allocateData(S32 size)
mData = (U8*)ll_aligned_malloc_16(size);
if (!mData)
{
- LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
- mBadBufferAllocation = true;
+ constexpr S32 MAX_TOLERANCE = 1024 * 1024 * 4; // 4 MB
+ if (size > MAX_TOLERANCE)
+ {
+ // If a big image failed to allocate, tollerate it for now.
+ // It's insightfull when crash logs without obvious cause are being analyzed,
+ // so a crash in a random location that normally is a mystery can get proper handling.
+ LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
+ }
+ else
+ {
+ // We are too far gone if we can't allocate a small buffer.
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
+ }
}
}
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index bdaef0c653..46ab6a441e 100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -67,7 +67,7 @@ private:
LLImageDecodeThread::LLImageDecodeThread(bool /*threaded*/)
: mDecodeCount(0)
{
- mThreadPool.reset(new LL::ThreadPool("ImageDecode", 8));
+ mThreadPool = std::make_unique<LL::ThreadPool>("ImageDecode", 8);
mThreadPool->start();
}