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:
@@ -288,8 +288,8 @@ public:
|
||||
/* We've read the block header; read the rest. Don't read past the end of the data chunk. */
|
||||
int iMaxSize = min( (int) m_WavData.m_iBlockAlign - 7 * m_WavData.m_iChannels, (m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos) - m_File.Tell() );
|
||||
|
||||
char *pBuf = (char *) alloca( iMaxSize );
|
||||
ASSERT( pBuf != NULL );
|
||||
char cBuf[iMaxSize];
|
||||
char* pBuf= cBuf;
|
||||
|
||||
int iBlockSize = m_File.Read( pBuf, iMaxSize );
|
||||
if( iBlockSize == 0 )
|
||||
|
||||
Reference in New Issue
Block a user