Skip to content

Commit 11cf04e

Browse files
authored
fix(voice): correct padding amount calculation (#229)
Fixes an incorrect calculation of voice padding introduced with 618f306, where the last byte was incorrectly unwrapped into a typed array. Ref: abalabahaha/eris#1558 (comment) Ref: https://datatracker.ietf.org/doc/html/rfc3550#section-5.1
1 parent 0114e58 commit 11cf04e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/voice/VoiceConnection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ class VoiceConnection extends EventEmitter {
964964

965965
// RFC3550 5.1: Padding (may need testing)
966966
if(hasPadding) {
967-
const paddingAmount = data.subarray(0, data.length - 1);
967+
const paddingAmount = data[data.length - 1];
968968
if(paddingAmount < data.length) {
969969
data = data.subarray(0, data.length - paddingAmount);
970970
}

0 commit comments

Comments
 (0)