Godot Engine – Multi-platform 2D and 3D game engine
Fix unsigned integer underflow with LocalVector size
Aaron Franke67d6048e45c7
diff --git a/editor/version_control/version_control_editor_plugin.cpp b/editor/version_control/version_control_editor_plugin.cppindex 79e867db2b7..104aa146ef9 100644--- a/editor/version_control/version_control_editor_plugin.cpp+++ b/editor/version_control/version_control_editor_plugin.cpp@@ -702,7 +702,7 @@ void VersionControlEditorPlugin::_display_diff_split_view(List<EditorVCSInterfacdiff_line.old_text = line;parsed_diff.push_back(diff_line);} else if (diff_line.old_line_no == -1) {- int32_t j = parsed_diff.size() - 1;+ int32_t j = (int32_t)parsed_diff.size() - 1;while (j >= 0 && parsed_diff[j].new_line_no == -1) {j--;}diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cppindex 5bb726c6b84..747f223f131 100644--- a/scene/animation/animation_player.cpp+++ b/scene/animation/animation_player.cpp@@ -299,7 +299,7 @@ void AnimationPlayer::_blend_playback_data(double p_delta, bool p_started) {// so it is best to use "deferred" calls instead of "immediate" for animation events that can trigger new animations._process_playback_data(b.data, p_delta, b.blend_left, false, false, false);}- for (int i = to_erase.size() - 1; i >= 0; i--) {+ for (int i = (int)to_erase.size() - 1; i >= 0; i--) {c.blend.remove_at(to_erase[i]);}}diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cppindex 00e5e5ab8b1..e1161ec0c64 100644--- a/scene/main/viewport.cpp+++ b/scene/main/viewport.cpp@@ -2719,7 +2719,7 @@ void Viewport::_gui_update_mouse_over() {}// Send Mouse Enter notifications.- for (int i = needs_enter.size() - 1; i >= 0; i--) {+ for (int i = (int)needs_enter.size() - 1; i >= 0; i--) {Control *ctrl = ObjectDB::get_instance<Control>(needs_enter[i]);if (ctrl) {ctrl->notification(Control::NOTIFICATION_MOUSE_ENTER);@@ -3409,7 +3409,7 @@ void Viewport::_update_mouse_over(Vector2 p_pos) {gui.sending_mouse_enter_exit_notifications = true;// Send Mouse Enter notifications to parents first.- for (int i = over_ancestors.size() - 1; i >= 0; i--) {+ for (int i = (int)over_ancestors.size() - 1; i >= 0; i--) {Control *ctrl = ObjectDB::get_instance<Control>(over_ancestors[i]);if (ctrl) {gui.mouse_over_hierarchy.push_back(over_ancestors[i]);diff --git a/servers/rendering/rendering_light_culler.cpp b/servers/rendering/rendering_light_culler.cppindex 05b7b2a3d3b..cf71d9cdbbf 100644--- a/servers/rendering/rendering_light_culler.cpp+++ b/servers/rendering/rendering_light_culler.cpp@@ -287,7 +287,8 @@ bool RenderingLightCuller::add_light_camera_planes_directional(LightCullPlanes &const LocalVector<uint8_t> &entry = _calculated_LUT[lookup];// each edge forms a plane- int n_edges = entry.size() - 1;+ DEV_ASSERT(entry.size() > 0);+ int n_edges = (int)entry.size() - 1;#elseuint8_t *entry = &data.LUT_entries[lookup][0];int n_edges = data.LUT_entry_sizes[lookup] - 1;