Removed alloca calls from sound reader classes because putting it inside a loop tends to cause a stack overflow.

Removed alloca call from png loading because it does not work with setjmp and longjmp.  png loading now uses exceptions instead when an error occurs.
This commit is contained in:
Kyzentun Keeslala
2016-06-21 19:23:37 -06:00
parent 5fca435b43
commit d4926506f9
4 changed files with 23 additions and 13 deletions
+1 -2
View File
@@ -667,8 +667,7 @@ int RageSoundReader_Resample_Good::Read( float *pBuf, int iFrames )
{
int iFramesNeeded = m_apResamplers[0]->NumInputsForOutputSamples(iFrames);
float *pTmpBuf = (float *) alloca( iFramesNeeded * sizeof(float) * iChannels );
ASSERT( pTmpBuf != NULL );
float pTmpBuf[iFramesNeeded * iChannels];
int iFramesIn = m_pSource->Read( pTmpBuf, iFramesNeeded );
if( iFramesIn < 0 )
return iFramesIn;