Merge pull request #47679 from madmiraal/fix-47436.1-3.x

[3.x] Check for empty ConcavePolygonShape2D before checking for intersection
This commit is contained in:
Rémi Verschelde 2021-04-06 22:36:01 +02:00 committed by GitHub
commit bd9ee18fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -744,6 +744,9 @@ bool ConcavePolygonShape2DSW::contains_point(const Vector2 &p_point) const {
bool ConcavePolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Vector2 &p_end, Vector2 &r_point, Vector2 &r_normal) const {
if (segments.size() == 0 || points.size() == 0)
return false;
uint32_t *stack = (uint32_t *)alloca(sizeof(int) * bvh_depth);
enum {