From d53aabefb06f67e50d8883a17d50b2cb3e1b0c29 Mon Sep 17 00:00:00 2001 From: meew0 Date: Tue, 5 Apr 2016 18:01:49 +0200 Subject: [PATCH] Fix an off by one error in volume transformation range checking --- lib/Voice/VolumeTransformer.js | 2 +- src/Voice/VolumeTransformer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Voice/VolumeTransformer.js b/lib/Voice/VolumeTransformer.js index ad01b6614..b0b1f5c48 100644 --- a/lib/Voice/VolumeTransformer.js +++ b/lib/Voice/VolumeTransformer.js @@ -50,7 +50,7 @@ var Volume = (function (_Transform) { // Check whether the index is actually in range - sometimes it's possible // that it skips ahead too far before the end condition of the for can // kick in. - if (i >= buffer.length) { + if (i >= buffer.length - 1) { break; } diff --git a/src/Voice/VolumeTransformer.js b/src/Voice/VolumeTransformer.js index 17cfb8136..6fc41d7f9 100644 --- a/src/Voice/VolumeTransformer.js +++ b/src/Voice/VolumeTransformer.js @@ -47,7 +47,7 @@ class Volume extends Transform { // Check whether the index is actually in range - sometimes it's possible // that it skips ahead too far before the end condition of the for can // kick in. - if (i >= buffer.length) { + if (i >= buffer.length - 1) { break; }