summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-09-15 20:43:02 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-09-15 20:43:02 +0300
commitb5861e58cb802118796d6a6ba7f45c8e8f67690b (patch)
treee0ab150d6f60177b1b5ce971ed608d27e0af09c0 /indra/llrender
parenteaf86980330251f1f5f8af5c4e9a7281d21a625c (diff)
parentc2a27c474dc11dff4f93b0bd319cfec7de27bb22 (diff)
Merge branch 'master' into DRTVWR-565-maint-P
Diffstat (limited to 'indra/llrender')
-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 46f0095c92..9dc140b5b9 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1248,7 +1248,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++)
@@ -1268,7 +1273,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++)
@@ -1291,7 +1301,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++)