fix potential crash

This commit is contained in:
Glenn Maynard
2004-05-19 01:52:40 +00:00
parent cec11a8454
commit 0366a45611
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ OSStatus AudioConverter::FormatConverterInputProc(UInt32& ioNumberDataPackets,
// This really shouldn't happen more than once, but better be sure. // This really shouldn't happen more than once, but better be sure.
if( mBufferSize != buf.mDataByteSize ) if( mBufferSize != buf.mDataByteSize )
{ {
delete mBuffer; delete [] mBuffer;
mBufferSize = buf.mDataByteSize; mBufferSize = buf.mDataByteSize;
mBuffer = new UInt8[mBufferSize]; mBuffer = new UInt8[mBufferSize];
} }
+1 -1
View File
@@ -11,7 +11,7 @@ class AudioConverter : public FormatConverterClient
{ {
public: public:
AudioConverter( RageSound_CA *driver, const Desc &procFormat ); AudioConverter( RageSound_CA *driver, const Desc &procFormat );
~AudioConverter() { delete mBuffer; } ~AudioConverter() { delete [] mBuffer; }
protected: protected:
OSStatus FormatConverterInputProc(UInt32& ioNumberDataPackets, OSStatus FormatConverterInputProc(UInt32& ioNumberDataPackets,
AudioBufferList& ioData, AudioBufferList& ioData,