mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
fix: Crash when passing invalid parameters to sound visualizer
Fixes #1208
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user