summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterbvhpreview.cpp
diff options
context:
space:
mode:
authornat-goodspeed <nat@lindenlab.com>2024-09-05 15:40:12 -0400
committerGitHub <noreply@github.com>2024-09-05 15:40:12 -0400
commit04568da18d2261f3f7b851cf5341b766c9648204 (patch)
tree83d5db1c173636bb77ebb33e860fac77ab5d79e8 /indra/newview/llfloaterbvhpreview.cpp
parent18d81e20f0b0044c16615953d7b69d7fb34d3449 (diff)
parentff2d79906ccef217194d5d9ec9d7025db03592a8 (diff)
Merge pull request #2513 from secondlife/lua-merge-dev
Merge develop branch into Lua project branch.
Diffstat (limited to 'indra/newview/llfloaterbvhpreview.cpp')
-rw-r--r--indra/newview/llfloaterbvhpreview.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 5330518ba5..3d81d01e16 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -285,7 +285,12 @@ bool LLFloaterBvhPreview::postBuild()
// create data buffer for keyframe initialization
S32 buffer_size = loaderp->getOutputSize();
- U8* buffer = new U8[buffer_size];
+ U8* buffer = new(std::nothrow) U8[buffer_size];
+ if (!buffer)
+ {
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS() << "Bad memory allocation for buffer, size: " << buffer_size << LL_ENDL;
+ }
LLDataPackerBinaryBuffer dp(buffer, buffer_size);
@@ -992,7 +997,12 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getDummyAvatar()->findMotion(floaterp->mMotionID);
S32 file_size = motionp->getFileSize();
- U8* buffer = new U8[file_size];
+ U8* buffer = new(std::nothrow) U8[file_size];
+ if (!buffer)
+ {
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ LL_ERRS() << "Bad memory allocation for buffer, size: " << file_size << LL_ENDL;
+ }
LLDataPackerBinaryBuffer dp(buffer, file_size);
if (motionp->serialize(dp))
@@ -1086,7 +1096,7 @@ bool LLPreviewAnimation::render()
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
gGL.loadIdentity();
- gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
+ gGL.ortho(0.0f, (F32)mFullWidth, 0.0f, (F32)mFullHeight, -1.0f, 1.0f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();