From eeded907828e904d7e3b241304bd4147096a9ae2 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Fri, 5 Jan 2018 21:22:11 +0000 Subject: [PATCH] Fix: "value" argument is out of bounds when writing timestamp header to packet --- src/client/voice/dispatcher/StreamDispatcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index 7c6b98c3e..1dbaceeb9 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -199,8 +199,8 @@ class StreamDispatcher extends Writable { const next = FRAME_LENGTH + (this.count * FRAME_LENGTH) - (Date.now() - this.startTime - this.pausedTime); setTimeout(done.bind(this), next); } - if (this._sdata.sequence === (2 ** 16) - 1) this._sdata.sequence = -1; - if (this._sdata.timestamp === (2 ** 32) - 1) this._sdata.timestamp = -TIMESTAMP_INC; + if (this._sdata.sequence >= (2 ** 16) - 1) this._sdata.sequence = -1; + if (this._sdata.timestamp >= (2 ** 32) - 1) this._sdata.timestamp = -TIMESTAMP_INC; this._sdata.sequence++; this._sdata.timestamp += TIMESTAMP_INC; this.count++;