summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-16 20:44:37 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-16 21:07:39 +0300
commit76491145885eb672961b564fa782af3777e08f12 (patch)
tree0929e225b721b2d4966d5cd205380c3b53d94446 /indra/llrender/llimagegl.cpp
parent5a3631659fb4fe8c2b70c90c490a6c7e486289e9 (diff)
parentf83289d3a7e80bebe47f696f96aee1b7e64d1d69 (diff)
Merge branch master (DRTVWR-571) into DRTVWR-559
# Conflicts: # indra/newview/llpanelface.cpp # indra/newview/llpanelface.h
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index d8e312106c..9c37381d4f 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1303,7 +1303,12 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
if (pixels != nullptr)
{
use_scratch = true;
- scratch = new U32[width * height];
+ scratch = new(std::nothrow) U32[width * height];
+ if (!scratch)
+ {
+ LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
+ << " bytes for a manual image W" << width << " H" << height << LL_ENDL;
+ }
U32 pixel_count = (U32)(width * height);
for (U32 i = 0; i < pixel_count; i++)
@@ -1323,7 +1328,12 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
if (pixels != nullptr)
{
use_scratch = true;
- scratch = new U32[width * height];
+ scratch = new(std::nothrow) U32[width * height];
+ if (!scratch)
+ {
+ LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
+ << " bytes for a manual image W" << width << " H" << height << LL_ENDL;
+ }
U32 pixel_count = (U32)(width * height);
for (U32 i = 0; i < pixel_count; i++)
@@ -1346,7 +1356,12 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
if (pixels != nullptr)
{
use_scratch = true;
- scratch = new U32[width * height];
+ scratch = new(std::nothrow) U32[width * height];
+ if (!scratch)
+ {
+ LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
+ << " bytes for a manual image W" << width << " H" << height << LL_ENDL;
+ }
U32 pixel_count = (U32)(width * height);
for (U32 i = 0; i < pixel_count; i++)