### Godot version

Godot Engine v4.0.2.stable.official.7a0977ce2

### System information

Ubuntu 22.10, 64bit, NVIDIA GeForce GTX 1650, Vulkan API 1.3.224

### Issue description

Godot crashes while painting a tilemap of a 900x900 pixels png texture while CTRL+SHIFT in the viewport.

### Steps to reproduce

1) Create 2D node scene.
2) Add child of type TileMap.
3) On the inspector, create new TileSet.
4) On the TileSet tab, drag and drop a 900x900 px png image.
5) Click on yes to the atlas prompt.
6) On the TileMap tab, select the whole picture.
7) Zoom out the viewport so you have enough room for loads of tiles. In my case 5% is enough to reproduce the bug.
8) In the viewport, click somewhere on the top left corner while pressing CTRL and SHIFT.
9) Drag the rect to the bottom right.
10) Release the click. There I see the crash.

![Peek 2023-04-26 14-16](https://user-images.githubusercontent.com/130976509/234572280-44f81866-770e-4134-ab39-61f6b3815cf1.gif)


### Minimal reproduction project

[CrashDemo.zip](https://github.com/godotengine/godot/files/11332654/CrashDemo.zip)

if (current_action == actions.size() - 1) {
		return;
	}
	for (int i = current_action + 1; i < actions.size(); i++) {
		for (Operation &E : actions.write[i].do_ops) {
			E.delete_reference();
		}
		
	}
	actions.resize(current_action + 1);
}
bool UndoRedo::_redo(bool p_execute) {
	ERR_FAIL_COND_V(action_level > 0, false);
	if ((current_action + 1) >= actions.size()) {
		return false; 
	}
	current_action++;
	if (p_execute) {
		_process_operation_list(actions.write[current_action].do_ops.front());
	}
	version++;
	emit_signal(SNAME("version_changed"));
	return true;
}
void UndoRedo::create_action(const String &p_name, MergeMode p_mode, bool p_backward_undo_ops) {