Fix: "value" argument is out of bounds when writing timestamp header to packet

This commit is contained in:
Amish Shah
2018-01-05 21:22:11 +00:00
parent ac7e066126
commit eeded90782

View File

@@ -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++;