diff options
| author | Andrey Lihatskiy <118752495+marchcat@users.noreply.github.com> | 2026-03-13 18:46:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-13 18:46:24 +0200 |
| commit | 5ffcdc3c9c3b33e04dbaa7397fc73d53857acd5b (patch) | |
| tree | e43e071daaa9f41a4d8e440d136e6e42b634db6e /indra/llimage | |
| parent | 28958ab7ae368d53b21888d178a9eb04ac6d82d2 (diff) | |
| parent | 419f94f9a975fb117facb94534509c9e83727549 (diff) | |
Merge pull request #5539 from secondlife/marchcat/slua-26.1-webrtc
26.1 -> SLua PV merge
Diffstat (limited to 'indra/llimage')
| -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; + } } } |
