fix potential crash
This commit is contained in:
@@ -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];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user