Skip to content

Conversation

@james58899
Copy link
Contributor

JavaScript converts operands to 32-bit signed int before doing bitwise operations.

Fix crash:

node:internal/buffer:72
    throw new ERR_OUT_OF_RANGE('value', range, value);
    ^

RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received -2147482816
    at new NodeError (node:internal/errors:371:5)
    at checkInt (node:internal/buffer:72:11)
    at writeU_Int32BE (node:internal/buffer:802:3)
    at Buffer.writeUInt32BE (node:internal/buffer:815:10)
    at VoiceConnection._sendAudioFrame (/home/james58899/MusicBot/node_modules/eris/lib/voice/VoiceConnection.js:807:24)
    at VoiceConnection.sendAudioFrame (/home/james58899/MusicBot/node_modules/eris/lib/voice/VoiceConnection.js:647:21)
    at VoiceConnection._send (/home/james58899/MusicBot/node_modules/eris/lib/voice/VoiceConnection.js:800:14)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7) {
  code: 'ERR_OUT_OF_RANGE'
}

@bsian03 bsian03 added the bug label Feb 14, 2022
@bsian03 bsian03 requested a review from abalabahaha March 8, 2022 23:50
@abalabahaha abalabahaha changed the title Fix bitwise overflow fix(voice): avoid bitwise overflow error Mar 27, 2022
@abalabahaha
Copy link
Owner

Someone was writing too much C for school... thanks

@abalabahaha abalabahaha merged commit 52db153 into abalabahaha:dev Mar 27, 2022
@james58899 james58899 deleted the fix-overflow branch March 31, 2022 16:04
DonovanDMC added a commit to DonovanDMC/eris that referenced this pull request Mar 31, 2022
DonovanDMC added a commit to DonovanArchive/ErisPRUpdateBot that referenced this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants