Skip to content

Commit

Permalink
Fix unchecked array access in build_*_planes
Browse files Browse the repository at this point in the history
(cherry picked from commit f054f76)
  • Loading branch information
nmrkr authored and akien-mga committed Feb 22, 2021
1 parent 6f4f49c commit 4f891b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/math/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ PoolVector<Plane> Geometry::build_box_planes(const Vector3 &p_extents) {
}

PoolVector<Plane> Geometry::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, PoolVector<Plane>());

PoolVector<Plane> planes;

Expand All @@ -899,6 +900,7 @@ PoolVector<Plane> Geometry::build_cylinder_planes(real_t p_radius, real_t p_heig
}

PoolVector<Plane> Geometry::build_sphere_planes(real_t p_radius, int p_lats, int p_lons, Vector3::Axis p_axis) {
ERR_FAIL_INDEX_V(p_axis, 3, PoolVector<Plane>());

PoolVector<Plane> planes;

Expand Down Expand Up @@ -932,6 +934,7 @@ PoolVector<Plane> Geometry::build_sphere_planes(real_t p_radius, int p_lats, int
}

PoolVector<Plane> Geometry::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, PoolVector<Plane>());

PoolVector<Plane> planes;

Expand Down

0 comments on commit 4f891b7

Please sign in to comment.