From cae867af4960bfe25c25f88f9dde2eacdb2a74b3 Mon Sep 17 00:00:00 2001 From: nanov Date: Wed, 30 Oct 2019 17:31:02 +0200 Subject: [PATCH] fix: get32IntFromBuffer to handle arbitary sizes --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 2ed6313..eac573f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -40,7 +40,7 @@ module.exports.get32IntFromBuffer = function (buffer, offset) { var size = 0; if ((size = buffer.length - offset) > 0) { if (size >= 4) { - return buffer.readUInt32BE(offset); + return buffer.readUIntBE(offset, size); } else { var res = 0; for (var i = offset + size, d = 0; i > offset; i--, d += 2) {