summaryrefslogtreecommitdiff
path: root/indra/llaudio/llaudiodecodemgr.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2018-08-11 09:02:16 -0400
committerNat Goodspeed <nat@lindenlab.com>2018-08-11 09:02:16 -0400
commitf6735af9315ed91a0d28804252c1351c9d4b379f (patch)
tree1b1fc36446fd12164f28a0d9b62bd2e89fd1601c /indra/llaudio/llaudiodecodemgr.cpp
parent00839eb6350627c6272dea242b85ea24544cea33 (diff)
parent470e4b5afc7f0fd516eca9d61b95ff770adf3978 (diff)
Automated merge with ssh://bitbucket.org/nat_linden/viewer-no-popup
Diffstat (limited to 'indra/llaudio/llaudiodecodemgr.cpp')
-rw-r--r--indra/llaudio/llaudiodecodemgr.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index 77e57b14f5..6ab61689fd 100644
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -265,9 +265,19 @@ BOOL LLVorbisDecodeState::initDecode()
mInFilep = NULL;
return FALSE;
}
-
- mWAVBuffer.reserve(size_guess);
- mWAVBuffer.resize(WAV_HEADER_SIZE);
+
+ try
+ {
+ mWAVBuffer.reserve(size_guess);
+ mWAVBuffer.resize(WAV_HEADER_SIZE);
+ }
+ catch (std::bad_alloc)
+ {
+ LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL;
+ delete mInFilep;
+ mInFilep = NULL;
+ return FALSE;
+ }
{
// write the .wav format header