Repository: godot
Issue: Crash when zooming out on shader in scene editor
Labels: bug,topic:rendering,crash

### Godot version

v4.0.1.stable.official

### System information

Linux, Windows

### Issue description

Godot crashes when zooming out in the 2D scene editor, using this shader. 

Shader code:

```
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform sampler2D noise1 : repeat_enable;
uniform sampler2D noise2 : repeat_enable;
uniform vec2 scroll1 = vec2(0.00005, 0.00005);
uniform vec2 scroll2 = vec2(-0.00005, -0.00005);
uniform float distortion_strenth : hint_range(-1,1) = 0.2;
uniform vec4 tone_color : source_color;
uniform vec4 top_color : source_color;
uniform float light_start : hint_range(0.0, 1.0) = 0.275;
uniform float light_end : hint_range(0.0, 1.0) = 0.4;

void fragment() {
	float depth = texture(noise1, UV + scroll1 * TIME).r * texture(noise2, UV + scroll2 * TIME).r;
	vec4 screen_col = texture(SCREEN_TEXTURE, SCREEN_UV + distortion_strenth * vec2(depth));
	vec4 top_light = smoothstep(light_start, light_end, depth) * top_color;
	COLOR = screen_col * tone_color + top_light;
	COLOR.a = 1.0;
}

```

```
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.1.stable.official (cacf49999e3fb37281d66cc591ca8bebc5712d4d)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38f50) [0x7fa3ba667f50] (??:0)
[2] /usr/lib/libc.so.6(+0x15c381) [0x7fa3ba78b381] (??:0)
[3] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x1b65e77] (??:0)
[4] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x1b6fd3b] (??:0)
[5] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x1bad196] (??:0)
[6] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x1bb0e65] (??:0)
[7] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x40dc84c] (??:0)
[8] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x3a7dacf] (??:0)
[9] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x3a9171a] (??:0)
[10] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0x3b661a2] (??:0)
[11] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0xec34d5] (??:0)
[12] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0xe03993] (??:0)
[13] /usr/lib/libc.so.6(+0x23790) [0x7fa3ba652790] (??:0)
[14] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7fa3ba65284a] (??:0)
[15] /home/mitrb/Godot_v4.0.1-stable_linux.x86_64() [0xe23a0e] (??:0)
-- END OF BACKTRACE --

```

### Steps to reproduce

1. Use the shader code on some texture in the 2D scene editor
2. zoom out
3. crash

### Minimal reproduction project

N/A

just add the shader code to a texture and zoom out of the 2D scene editor:

```
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform sampler2D noise1 : repeat_enable;
uniform sampler2D noise2 : repeat_enable;
uniform vec2 scroll1 = vec2(0.00005, 0.00005);
uniform vec2 scroll2 = vec2(-0.00005, -0.00005);
uniform float distortion_strenth : hint_range(-1,1) = 0.2;
uniform vec4 tone_color : source_color;
uniform vec4 top_color : source_color;
uniform float light_start : hint_range(0.0, 1.0) = 0.275;
uniform float light_end : hint_range(0.0, 1.0) = 0.4;

void fragment() {
	float depth = texture(noise1, UV + scroll1 * TIME).r * texture(noise2, UV + scroll2 * TIME).r;
	vec4 screen_col = texture(SCREEN_TEXTURE, SCREEN_UV + distortion_strenth * vec2(depth));
	vec4 top_light = smoothstep(light_start, light_end, depth) * top_color;
	COLOR = screen_col * tone_color + top_light;
	COLOR.a = 1.0;
}
```