summaryrefslogtreecommitdiff
path: root/indra/llaudio
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-08-07 16:10:46 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-08-07 16:10:46 +0300
commitac5a5470191431dcdc0f97c8c144d677d76c92f0 (patch)
tree841a19200124655a13317a972e87ac412d208b61 /indra/llaudio
parente236da41e96ac88e8f8c6b1a6a4a9f3a25c923b8 (diff)
MAINT-8958 Handle initDecode crash
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