From 56d38b8e90eb74f36cd75e3e63506bde9827df67 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 9 Nov 2026 15:28:18 +0100 Subject: [PATCH] fixed JS_GetTypedArrayBuffer() length reporting with resizable array buffers (#608) --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index 9c67217..8f36a55 100644 --- a/quickjs.c +++ b/quickjs.c @@ -61535,7 +61535,7 @@ JSValue JS_GetTypedArrayBuffer(JSContext *ctx, JSValueConst obj, if (pbyte_offset) *pbyte_offset = ta->offset; if (pbyte_length) - *pbyte_length = ta->length; + *pbyte_length = (size_t)p->u.array.count << typed_array_size_log2(p->class_id); if (pbytes_per_element) { *pbytes_per_element = 1 << typed_array_size_log2(p->class_id); } -- 2.47.3