diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-03-12 19:09:06 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-03-12 19:09:06 +0200 |
| commit | 82d018806a79553cc53a91027760eed5282f2d6b (patch) | |
| tree | 06ccac7daa2abbb3ec39ff34c1ce161dfc4e823f /indra/llimage/llimage.cpp | |
| parent | 28958ab7ae368d53b21888d178a9eb04ac6d82d2 (diff) | |
| parent | 18db816ef7552785ffa26d6d0397efbb341a999f (diff) | |
Merge branch 'main' into marchcat/slua-26.1
# Conflicts:
# autobuild.xml
# indra/llwindow/llwindowwin32.cpp
# indra/newview/llappviewer.cpp
# indra/newview/llinventorygallerymenu.cpp
Diffstat (limited to 'indra/llimage/llimage.cpp')
| -rw-r--r-- | indra/llimage/llimage.cpp | 16 |
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; + } } } |
