Skip to content

Commit cd1531d

Browse files
Hema2-officialLulalabypre-commit-ci[bot]
authored
fix: VoiceClient crashes while receiving audio (#2800)
Signed-off-by: Hema2 <[email protected]> Co-authored-by: Lala Sabathil <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e391c82 commit cd1531d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ These changes are available on the `master` branch, but have not yet been releas
111111
([#2779](https://github.com/Pycord-Development/pycord/pull/2779))
112112
- Fixed GIF-based `Sticker` returning the wrong `url`.
113113
([#2781](https://github.com/Pycord-Development/pycord/pull/2781))
114+
- Fixed `VoiceClient` crashing randomly while receiving audio
115+
([#2800](https://github.com/Pycord-Development/pycord/pull/2800))
114116

115117
### Changed
116118

discord/voice_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def _decrypt_xsalsa20_poly1305_lite(self, header, data):
613613

614614
@staticmethod
615615
def strip_header_ext(data):
616-
if data[0] == 0xBE and data[1] == 0xDE and len(data) > 4:
616+
if len(data) > 4 and data[0] == 0xBE and data[1] == 0xDE:
617617
_, length = struct.unpack_from(">HH", data)
618618
offset = 4 + length * 4
619619
data = data[offset:]

0 commit comments

Comments
 (0)