### Godot version

2992ffd25523cb8b3e0ef1b873c40115b8940178

### System information

Windows 10

### Issue description

Godot crashes randomly within a few seconds after project start when moving with the mouse.

![win_err](https://github.com/godotengine/godot/assets/52464204/1da28596-d95b-40f3-b32f-12219ec02c5d)

Started after recent merge of https://github.com/godotengine/godot/pull/67791.
I can confirm that reverting the pr fixes the crashes.

### Steps to reproduce

see desc

### Minimal reproduction project

N/A
screen_size.x = video_mode.x;
				screen_size.y = video_mode.x / viewport_aspect;
			}
		}
		screen_size = screen_size.floor();
		viewport_size = viewport_size.floor();
		Size2 margin;
		Size2 offset;
		if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.x < video_mode.x) {
			margin.x = Math::round((video_mode.x - screen_size.x) / 2.0);
			offset.x = Math::round(margin.x * viewport_size.y / screen_size.y);
		} else if (content_scale_aspect != CONTENT_SCALE_ASPECT_EXPAND && screen_size.y < video_mode.y) {
			margin.y = Math::round((video_mode.y - screen_size.y) / 2.0);
			offset.y = Math::round(margin.y * viewport_size.x / screen_size.x);
		}
		switch (content_scale_mode) {
			case CONTENT_SCALE_MODE_DISABLED: {
				
				
			} break;
			case CONTENT_SCALE_MODE_CANVAS_ITEMS: {
				final_size = screen_size;
				final_size_override = viewport_size / content_scale_factor;
				attach_to_screen_rect = Rect2(margin, screen_size);
				font_oversampling = (screen_size.x / viewport_size.x) * content_scale_factor;
				window_transform.translate_local(margin);
			} break;
			case CONTENT_SCALE_MODE_VIEWPORT: {
				final_size = (viewport_size / content_scale_factor).floor();
				attach_to_screen_rect = Rect2(margin, screen_size);