MAINT-8958 Handle initDecode crash

meow-7.2.2
andreykproductengine 2018-08-07 16:10:46 +03:00
parent e236da41e9
commit ac5a547019
1 changed files with 13 additions and 3 deletions

View File

@ -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