Merge pull request #38465 from madmiraal/fix-38457

Check for empty vectors before trying to access a pointer to the first element in Octree<T, use_pairs, AL>::cull_convex().
This commit is contained in:
Rémi Verschelde 2020-05-05 08:04:04 +02:00 committed by GitHub
commit 1c23a0cc7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1290,10 +1290,12 @@ void Octree<T, use_pairs, AL>::_cull_point(Octant *p_octant, const Vector3 &p_po
template <class T, bool use_pairs, class AL>
int Octree<T, use_pairs, AL>::cull_convex(const Vector<Plane> &p_convex, T **p_result_array, int p_result_max, uint32_t p_mask) {
if (!root)
if (!root || p_convex.size() == 0)
return 0;
Vector<Vector3> convex_points = Geometry::compute_convex_mesh_points(&p_convex[0], p_convex.size());
if (convex_points.size() == 0)
return 0;
int result_count = 0;
pass++;