Skip to content

fix: VoiceClient crashes while receiving audio #2800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 3, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion discord/voice_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def _decrypt_xsalsa20_poly1305_lite(self, header, data):

@staticmethod
def strip_header_ext(data):
if data[0] == 0xBE and data[1] == 0xDE and len(data) > 4:
if len(data) > 4 and data[0] == 0xBE and data[1] == 0xDE:
_, length = struct.unpack_from(">HH", data)
offset = 4 + length * 4
data = data[offset:]
Expand Down