fix: Crash when passing invalid parameters to sound visualizer
Fixes #1208
This commit is contained in:
parent
27c8e19c14
commit
4792a29fac
@ -378,6 +378,11 @@ namespace hex::plugin::builtin {
|
||||
static u64 index = 0;
|
||||
static TaskHolder resetTask;
|
||||
|
||||
if (sampleRate == 0)
|
||||
throw std::logic_error(hex::format("Invalid sample rate: {}", sampleRate));
|
||||
else if (channels == 0)
|
||||
throw std::logic_error(hex::format("Invalid channel count: {}", channels));
|
||||
|
||||
if (shouldReset) {
|
||||
waveData.clear();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user