diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-11 14:35:29 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-11 14:35:29 +0100 |
commit | 7725a1a14cd316552f8b379d5e7efca5d56266ae (patch) | |
tree | 8e0c7780d2607a2d847df3ed1bf8d3fa734ef106 /modules | |
parent | 5c5f1452db762bbbd9c92b4c416803abada571b8 (diff) | |
parent | 9e4d80e08e35279af5f95915f64b980c0f9c7ba3 (diff) |
Merge pull request #73068 from dsnopek/webxr-bounds-geometry-bug
Fix byte packing (and buffer overrun) in godot_webxr_get_bounds_geometry()
Diffstat (limited to 'modules')
-rw-r--r-- | modules/webxr/native/library_godot_webxr.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/webxr/native/library_godot_webxr.js b/modules/webxr/native/library_godot_webxr.js index 1c00ebebb4..5c01d88a30 100644 --- a/modules/webxr/native/library_godot_webxr.js +++ b/modules/webxr/native/library_godot_webxr.js @@ -584,12 +584,11 @@ const GodotWebXR = { } const buf = GodotRuntime.malloc(point_count * 3 * 4); - GodotRuntime.setHeapValue(buf, point_count, 'i32'); for (let i = 0; i < point_count; i++) { const point = GodotWebXR.space.boundsGeometry[i]; - GodotRuntime.setHeapValue(buf + ((i * 3) + 1) * 4, point.x, 'float'); - GodotRuntime.setHeapValue(buf + ((i * 3) + 2) * 4, point.y, 'float'); - GodotRuntime.setHeapValue(buf + ((i * 3) + 3) * 4, point.z, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 0) * 4, point.x, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 1) * 4, point.y, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 2) * 4, point.z, 'float'); } GodotRuntime.setHeapValue(r_points, buf, 'i32'); |