summaryrefslogtreecommitdiff
path: root/indra/llimage/llimage.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2026-01-21 15:33:19 -0500
committerRye <rye@alchemyviewer.org>2026-01-21 16:05:51 -0500
commit8896239134a40f41d845c78551d24e005d691d7c (patch)
treeb5f823454cf491c4a83ecc8cf987cf465854ca30 /indra/llimage/llimage.cpp
parentd0db6a49eb7c7dddcde2a340c8ad6c1f1af6e2cf (diff)
parent0b2f7fcc6b67f629b41a804f77214d51497127a7 (diff)
Merge remote-tracking branch 'origin/develop' into develop-linux
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rw-r--r--indra/llimage/llimage.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index bea33c04ed..b4d34f536c 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;
+ }
}
}