From 1df92afcfebd7df3173eb088dc00e9ac33b3b333 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 17 Aug 2023 02:53:01 +0100 Subject: [PATCH] check size of script --- lib/base.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/base.ps1 b/lib/base.ps1 index edff3f2..e603dab 100644 --- a/lib/base.ps1 +++ b/lib/base.ps1 @@ -188,6 +188,9 @@ function Set_By_Script { param( [string]$script ) + if ($script.Length -gt 48000) { + throw [VMError]::new("Script size cannot be larger than 48kB") + } $retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script) if ($retval -notin @(0)) { throw [CAPIError]::new($retval, "VBVMR_SetParameters")