summaryrefslogtreecommitdiff
path: root/indra/llimage/llimage.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-16 11:44:55 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-16 11:44:55 -0700
commit353329c2c2e9e8fa1ff273de2016c9e155585f45 (patch)
treef5098b9532f6d7b757b9a8fb345e7aa5e7e69108 /indra/llimage/llimage.cpp
parente95b7efd0b4469ce18bce3bc0261ecc9be06ea9c (diff)
parent9957c28ddc5e5c129af2db662da7d69f1509af65 (diff)
DRTVWR-546 merge in master v6.5.1
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rw-r--r--indra/llimage/llimage.cpp7
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 ;
}