1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-19 06:07:42 +02:00

Bug 1501 again: don't crash for extreme Start values for FindClipping

This commit is contained in:
Paul Licameli 2016-08-28 15:49:55 -04:00
parent 36ddd98757
commit 38ee7c0e3e

View File

@ -159,7 +159,17 @@ bool EffectFindClipping::ProcessOne(LabelTrack * lt,
return true;
}
float *buffer = new float[blockSize];
float *buffer;
try {
if (blockSize < mStart)
// overflow
throw std::bad_alloc{};
buffer = new float[blockSize];
}
catch( const std::bad_alloc & ) {
wxMessageBox(_("Requested value exceeds memory capacity."));
return false;
}
float *ptr = buffer;