1
0
mirror of synced 2025-01-29 19:17:28 +01:00

fix: Crash when passing invalid parameters to sound visualizer

Fixes #1208
This commit is contained in:
WerWolv 2023-07-26 22:13:39 +02:00
parent 27c8e19c14
commit 4792a29fac

View File

@ -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();