From b28b677be27a1d8efb529bd390fd1b136cd298f0 Mon Sep 17 00:00:00 2001 From: goyuken Date: Wed, 10 Oct 2012 11:56:49 +0000 Subject: [PATCH] dcfilter: reject out of range filterwidth --- BizHawk.Emulation/Sound/Utilities/DCFilter.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BizHawk.Emulation/Sound/Utilities/DCFilter.cs b/BizHawk.Emulation/Sound/Utilities/DCFilter.cs index 079bfe96e6..0c29b44af4 100644 --- a/BizHawk.Emulation/Sound/Utilities/DCFilter.cs +++ b/BizHawk.Emulation/Sound/Utilities/DCFilter.cs @@ -32,6 +32,8 @@ namespace BizHawk.Emulation.Sound.Utilities /// public DCFilter(ISoundProvider input = null, int filterwidth = 65536) { + if (filterwidth < 1 || filterwidth > 65536) + throw new ArgumentOutOfRangeException(); this.input = input; this.depth = filterwidth; this.buffer = new Queue(depth * 2);