From 87be2790c0a97e206713aaf62ec906bb64fe3ce5 Mon Sep 17 00:00:00 2001 From: codepage949 Date: Sun, 20 Mar 2022 00:26:43 +0900 Subject: [PATCH] [#3145] byteOffset of typedArray is not handled properly --- lib/input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/input.js b/lib/input.js index 1469bbae2..de5cea603 100644 --- a/lib/input.js +++ b/lib/input.js @@ -39,7 +39,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) { if (input.length === 0) { throw Error('Input Bit Array is empty'); } - inputDescriptor.buffer = Buffer.from(input.buffer); + inputDescriptor.buffer = Buffer.from(input.buffer, input.byteOffset, input.byteLength); } else if (is.plainObject(input) && !is.defined(inputOptions)) { // Plain Object descriptor, e.g. create inputOptions = input;