From f054f760e64b3b1768e9f8b6928bd38d6c41532b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Delf=20Neum=C3=A4rker?= Date: Sat, 20 Feb 2021 22:27:08 +0100 Subject: Fix unchecked array access in build_*_planes --- core/math/geometry_3d.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core') diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index a4a7463bfd..6628b760e0 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -775,6 +775,8 @@ Vector Geometry3D::build_box_planes(const Vector3 &p_extents) { } Vector Geometry3D::build_cylinder_planes(real_t p_radius, real_t p_height, int p_sides, Vector3::Axis p_axis) { + ERR_FAIL_INDEX_V(p_axis, 3, Vector()); + Vector planes; const double sides_step = Math_TAU / p_sides; @@ -796,6 +798,8 @@ Vector Geometry3D::build_cylinder_planes(real_t p_radius, real_t p_height } Vector Geometry3D::build_sphere_planes(real_t p_radius, int p_lats, int p_lons, Vector3::Axis p_axis) { + ERR_FAIL_INDEX_V(p_axis, 3, Vector()); + Vector planes; Vector3 axis; @@ -827,6 +831,8 @@ Vector Geometry3D::build_sphere_planes(real_t p_radius, int p_lats, int p } Vector Geometry3D::build_capsule_planes(real_t p_radius, real_t p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { + ERR_FAIL_INDEX_V(p_axis, 3, Vector()); + Vector planes; Vector3 axis; -- cgit v1.2.3