From 91eb2f49dbf1e84da5e64f20a2b3c5b6f37f3c83 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Feb 2023 10:44:45 -0700 Subject: [PATCH] [wasm-api-buffer] Minor variable --- src/hb-wasm-api-buffer.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-wasm-api-buffer.hh b/src/hb-wasm-api-buffer.hh index fd0d1dd95..dd189463a 100644 --- a/src/hb-wasm-api-buffer.hh +++ b/src/hb-wasm-api-buffer.hh @@ -133,8 +133,9 @@ HB_WASM_API (bool_t, buffer_copy_contents) (HB_WASM_EXEC_ENV module_free (contents->pos); contents->length = length; - contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, length * sizeof (buffer->info[0])); - contents->pos = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->pos, length * sizeof (buffer->pos[0])); + unsigned bytes = length * sizeof (hb_glyph_info_t); + contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, bytes); + contents->pos = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->pos, bytes); if (length && (!contents->info || !contents->pos)) {