Repository: godot
Issue: Executing `Geometry.intersect_polygons_2d` crashes Godot
Labels: bug,crash,topic:2d

### Godot version

3.5.beta.custom_build. 20b08185f

### System information

Ubuntu 21.10 - Nvidia GTX 970, Gnome shell 40.4 X11

### Issue description

When executing
```
	var temp_variable7887 = ClassDB.instance("_Geometry")
	temp_variable7887.intersect_polygons_2d(PoolVector2Array([Vector2(-64.926964, 10.704052), Vector2(60.383736, 95.01445), Vector2(30.612326, -50.613689), Vector2(34.869991, 38.477768), Vector2(85.156479, 39.491631), Vector2(INF, -75.29393), Vector2(-65.556992, -41.916084), Vector2(-0.869407, 0.494096), Vector2(-88.231255, 56.422867), Vector2(-29.884922, 86.812759), Vector2(-0.805967, -0.59196), Vector2(-0.018404, 0.999831), Vector2(0.933284, 0.35914), Vector2(0.001493, -0.999999), Vector2(53.761898, -46.386345), Vector2(-60.032719, -48.855011), Vector2(-44.943153, 40.302132), Vector2(-81.904655, 98.2985), Vector2(INF, 57.408928), Vector2(-0.991297, 0.131647), Vector2(0.798135, 0.602478), Vector2(-48.542969, -90.853035), Vector2(-26.348131, 31.78141), Vector2(-53.456566, -15.682197), Vector2(-0.664113, 0.747632)]), PoolVector2Array([]))
```

Godot crashes with this backtrace
```
core/math/geometry.cpp:1088:40: runtime error: inf is outside the range of representable values of type 'long long int'

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737346906048) at pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737346906048) at pthread_kill.c:80
#2  __GI___pthread_kill (threadid=140737346906048, signo=signo@entry=6) at pthread_kill.c:91
#3  0x00007ffff7ab6476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff7a9c7b7 in __GI_abort () at abort.c:79
#5  0x0000000001836ec9 in __gnu_cxx::__verbose_terminate_handler() [clone .cold] ()
#6  0x0000000004f7550c in __cxxabiv1::__terminate(void (*)()) ()
#7  0x0000000004f75577 in std::terminate() ()
#8  0x0000000004f7572d in __cxa_rethrow ()
#9  0x000000000495171f in ClipperLib::ClipperBase::AddPath (this=0x7fffffffb3d8, pg=..., PolyTyp=ClipperLib::ptSubject, Closed=true) at thirdparty/misc/clipper.cpp:1113
#10 0x00000000049517bf in ClipperLib::ClipperBase::AddPaths (this=0x7fffffffb3d8, ppg=..., PolyTyp=ClipperLib::ptSubject, Closed=true) at thirdparty/misc/clipper.cpp:1260
#11 0x000000000495ab50 in ClipperLib::ClipperOffset::Execute (this=0x7fffffffb540, solution=..., delta=639878.5) at thirdparty/misc/clipper.cpp:3927
#12 0x0000000004be3b01 in Geometry::_polypath_offset (p_polypath=..., p_delta=6.39878511, p_join_type=(Geometry::JOIN_MITER | unknown: 0xffffffac), p_end_type=Geometry::END_POLYGON)
    at core/math/geometry.cpp:1170
#13 0x0000000004d0a6d6 in Geometry::offset_polygon_2d (p_polygon=..., p_delta=6.39878511, p_join_type=(Geometry::JOIN_MITER | unknown: 0xffffffac)) at ./core/math/geometry.h:888
#14 0x0000000004cf1c81 in _Geometry::offset_polygon_2d (this=0xebdeb70, p_polygon=..., p_delta=6.39878511, p_join_type=(_Geometry::JOIN_MITER | unknown: 0xffffffac)) at core/bind/core_bind.cpp:1791
#15 0x0000000004d34f7b in MethodBind3R<Array, Vector<Vector2> const&, float, _Geometry::PolyJoinType>::call (this=0x70d9240, p_object=0xebdeb70, p_args=0x7fffffffb910, p_arg_count=3, r_error=...)
    at ./core/method_bind.gen.inc:2453
#16 0x0000000004a25250 in Object::call (this=0xebdeb70, p_method=..., p_args=0x7fffffffb910, p_argcount=3, r_error=...) at core/object.cpp:918
#17 0x0000000004a24a89 in Object::callv (this=0xebdeb70, p_method=..., p_args=...) at core/object.cpp:827
#18 0x0000000004a3bc41 in MethodBind2R<Variant, StringName const&, Array const&>::call (this=0x705fe00, p_object=0xebdeb70, p_args=0x7fffffffbe48, p_arg_count=2, r_error=...) at ./core/method_bind.gen.inc:1681
#19 0x0000000004a25250 in Object::call (this=0xebdeb70, p_method=..., p_args=0x7fffffffbe48, p_argcount=2, r_error=...) at core/object.cpp:918
#20 0x0000000004ac5fa9 in Variant::call_ptr (this=0x7fffffffbcb0, p_method=..., p_args=0x7fffffffbe48, p_argcount=2, r_ret=0x7fffffffbdb8, r_error=...) at core/variant_call.cpp:1185
#21 0x0000000001991e12 in GDScriptFunction::call (this=0xcec7f30, p_instance=0xb688940, p_args=0x0, p_argcount=0, r_err=..., p_state=0x0) at modules/gdscript/gdscript_function.cpp:1048
#22 0x0000000001932c3d in GDScriptInstance::call (this=0xb688940, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at modules/gdscript/gdscript.cpp:1196
#23 0x0000000004a25135 in Object::call (this=0xce78d60, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at core/object.cpp:899
#24 0x0000000004ac5fa9 in Variant::call_ptr (this=0x7fffffffcf50, p_method=..., p_args=0x0, p_argcount=0, r_ret=0x0, r_error=...) at core/variant_call.cpp:1185
#25 0x0000000001991e47 in GDScriptFunction::call (this=0xceda330, p_instance=0xb688940, p_args=0x7fffffffd0c8, p_argcount=1, r_err=..., p_state=0x0) at modules/gdscript/gdscript_function.cpp:1050
#26 0x0000000001932d24 in GDScriptInstance::call_multilevel (this=0xb688940, p_method=..., p_args=0x7fffffffd0c8, p_argcount=1) at modules/gdscript/gdscript.cpp:1211
#27 0x000000000398876e in Node::_notification (this=0xce78d60, p_notification=17) at scene/main/node.cpp:56
#28 0x00000000018ef52c in Node::_notificationv (this=0xce78d60, p_notification=17, p_reversed=false) at scene/main/node.h:45
#29 0x0000000004a25393 in Object::notification (this=0xce78d60, p_notification=17, p_reversed=false) at core/object.cpp:927
#30 0x00000000039c46fd in SceneTree::_notify_group_pause (this=0xa438f20, p_group=..., p_notification=17) at scene/main/scene_tree.cpp:1069
#31 0x00000000039c1e16 in SceneTree::idle (this=0xa438f20, p_time=0.130941212) at scene/main/scene_tree.cpp:605
#32 0x000000000188d72c in Main::iteration () at main/main.cpp:2271
#33 0x000000000184df5a in OS_X11::run (this=0x7fffffffd540) at platform/x11/os_x11.cpp:3842
#34 0x0000000001839b0b in main (argc=1, argv=0x7fffffffde78) at platform/x11/godot_x11.cpp:55


terminate called after throwing an instance of 'ClipperLib::clipperException'
  what():  Coordinate outside allowed range

```


This example was found by Godot fuzzer - [Qarminer](https://github.com/qarmin/Qarminer), so it is quite unlikelly that this code could be used in real project, but still this should be handled gracefully.


### Steps to reproduce

Above

### Minimal reproduction project

_No response_