diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-23 21:23:45 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-23 21:23:45 -0500 |
commit | d71e0a6d4778d4c67b8793ba569fee2db226bc8e (patch) | |
tree | dce713230aa611dbada3c6f78903d988b1ae06a4 /indra/llimage | |
parent | 67ace0df9953ce3264048c3946720a9df492edfa (diff) | |
parent | 8852cb9cbd25df8d25fa43cf39b222ab8381ebd6 (diff) |
SL-16094, SL-16400: Merge branch 'DRTVWR-546' into glthread
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimage.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 5c49ec02ea..2bf5f5492e 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1451,7 +1451,7 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) setDataAndSize(new_data, new_width, new_height, components); } } - else + else try { // copy out existing image data S32 temp_data_size = old_width * old_height * components; @@ -1485,6 +1485,11 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) } } } + catch (std::bad_alloc&) // for temp_buffer + { + LL_WARNS() << "Failed to allocate temporary image buffer" << LL_ENDL; + return false; + } return true ; } |