summaryrefslogtreecommitdiff
path: root/indra/llaudio
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-27 19:54:10 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-27 19:54:10 +0100
commita84ee929a5221aec07bcc93815ca6c57bb8ab6bb (patch)
treeecf9694b9e772161b67c8b0935362b0e05cc7c7d /indra/llaudio
parent4d4255c27b45ed5e32fe7c4870e2ce3ed10cb140 (diff)
parent58aef8beaf79dc83546a7b080014ca5030733ac8 (diff)
merge
Diffstat (limited to 'indra/llaudio')
-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