mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-07 20:22:13 +01:00
Fix possible memory leak in use of overrides of BlockFile::CalcSummary
This commit is contained in:
@@ -337,14 +337,12 @@ int ODDecodeBlockFile::WriteODDecodeBlockFile()
|
||||
sampleData.ptr(),
|
||||
mLen,
|
||||
mFormat,
|
||||
NULL);//summaryData);
|
||||
NULL);
|
||||
wxASSERT(bSuccess); // TODO: Handle failure here by alert to user and undo partial op.
|
||||
wxUnusedVar(bSuccess);
|
||||
|
||||
mFileNameMutex.Unlock();
|
||||
|
||||
// delete [] (char *) summaryData;
|
||||
|
||||
|
||||
mDataAvailableMutex.Lock();
|
||||
mDataAvailable=true;
|
||||
@@ -394,9 +392,10 @@ wxFileName ODDecodeBlockFile::GetFileName()
|
||||
/// @param len The length of the sample data
|
||||
/// @param format The format of the sample data.
|
||||
void *ODDecodeBlockFile::CalcSummary(samplePtr buffer, sampleCount len,
|
||||
sampleFormat format)
|
||||
sampleFormat format, ArrayOf<char> &cleanup)
|
||||
{
|
||||
char* localFullSummary = new char[mSummaryInfo.totalSummaryBytes];
|
||||
cleanup.reinit(mSummaryInfo.totalSummaryBytes);
|
||||
char* localFullSummary = cleanup.get();
|
||||
|
||||
memcpy(localFullSummary, bheaderTag, bheaderTagLen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user