grover / homebridge-dacp

Remotely control Apple TV and iTunes via HomeKit.
MIT License
151 stars 14 forks source link

FIx for [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range… #62

Open torandreroland opened 5 years ago

torandreroland commented 5 years ago

Change conversion of long to integer from using buffer.readIntBE to buffer.readUInt32BE as node.js since version 10.0 checks that paramter byteLength in buffer.readIntBE is less than 6. One can argue that this should use buffer.readBigInt64BE but that is only available in node.js 12.0

jeromeof commented 4 years ago

Would be great if this was merged so we can install this plugin in the new Homebridge config UI

machineglow commented 3 years ago

I found I had to change the conversion in the decode function for long and ulong to that as well on lines 927-929:

        } else if (type.type === 'long') {
          value = buffer.readUInt32BE(index + 8);
        } else if (type.type === 'ulong') {
          value = buffer.readUInt32BE(index + 8);