Skip to content

Commit cae867a

Browse files
committed
fix: get32IntFromBuffer to handle arbitary sizes
1 parent 9e20105 commit cae867a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports.get32IntFromBuffer = function (buffer, offset) {
4040
var size = 0;
4141
if ((size = buffer.length - offset) > 0) {
4242
if (size >= 4) {
43-
return buffer.readUInt32BE(offset);
43+
return buffer.readUIntBE(offset, size);
4444
} else {
4545
var res = 0;
4646
for (var i = offset + size, d = 0; i > offset; i--, d += 2) {

0 commit comments

Comments
 (0)