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:
parent
36ddd98757
commit
38ee7c0e3e
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user