diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-09-27 13:04:12 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-09-27 13:04:12 +0300 |
commit | 892d3a9bf870bd4af802a8cd742130649c627cf2 (patch) | |
tree | cf13c94a613e0c567fbe0ed7ad0e075b4c3877bd /indra/llaudio | |
parent | 3f970601339fa34937454fd83820ffb1c7d6b295 (diff) | |
parent | 58aef8beaf79dc83546a7b080014ca5030733ac8 (diff) |
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llaudio')
-rw-r--r-- | indra/llaudio/llaudiodecodemgr.cpp | 16 |
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 |