### Godot version

v4.0.beta9.official [e780dc332]

### System information

macOS Ventura 13.0.1 (Intel), Radeon Pro 580 8 GB

### Issue description

When setting the size of a SubViewport (that is inside the corresponding SubViewportContainer) to zero, the editor crashes instantly.

**But it only happens when I set the size of the SubViewport by sliding the values.**

You can see what happens in this video:


https://user-images.githubusercontent.com/91340577/209363880-503d3dff-80e1-4e9e-bb57-d059fdbfeed0.mp4

At the end of the video you can see the crash message of macOS reading: _Godot quit unexpectedly._

If I write the number zero (or any negative) to the values of the SubViewport size, the crash doesn't happens.

### Steps to reproduce

1. Add a SubViewportContainer
2. Add a SubViewport as a child of the SubViewportContainer
3. Set the size of the SubViewport to zero **by sliding** the X or the Y value.

### Minimal reproduction project

1. Open the project
2. Go to the Control.tscn scene
3. Select the SubViewport node
4. Slide the X or Y values of the size to zero

[SubViewportCrash.zip](https://github.com/godotengine/godot/files/10296101/SubViewportCrash.zip)
}
		for (const KeyValue<Viewport::CanvasKey, Viewport::CanvasData *> &E : canvas_map) {
			RendererCanvasCull::Canvas *canvas = static_cast<RendererCanvasCull::Canvas *>(E.value->canvas);
			Transform2D xform = _canvas_get_transform(p_viewport, canvas, E.value, clip_rect.size);
			RendererCanvasRender::Light *canvas_lights = nullptr;
			RendererCanvasRender::Light *canvas_directional_lights = nullptr;
			RendererCanvasRender::Light *ptr = lights;
			while (ptr) {
				if (E.value->layer >= ptr->layer_min && E.value->layer <= ptr->layer_max) {
					ptr->next_ptr = canvas_lights;
					canvas_lights = ptr;
				}
				ptr = ptr->filter_next_ptr;
			}
			ptr = directional_lights;
			while (ptr) {
				if (E.value->layer >= ptr->layer_min && E.value->layer <= ptr->layer_max) {
					ptr->next_ptr = canvas_directional_lights;
					canvas_directional_lights = ptr;
				}
				ptr = ptr->filter_next_ptr;
			}
			RSG::canvas->render_canvas(p_viewport->render_target, canvas, xform, canvas_lights, canvas_directional_lights, clip_rect, p_viewport->texture_filter, p_viewport->texture_repeat, p_viewport->snap_2d_transforms_to_pixel, p_viewport->snap_2d_vertices_to_pixel, p_viewport->canvas_cull_mask);
			if (RSG::canvas->was_sdf_used()) {
				p_viewport->sdf_active = true;
			}
			if (scenario_draw_canvas_bg && E.key.get_layer() >= scenario_canvas_max_layer) {
				
				
				RSG::texture_storage->render_target_do_clear_request(p_viewport->render_target);