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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user