Repository: godot
Issue: Random nvoglv32.dll crashes
Labels: bug,platform:windows,topic:rendering,needs testing,crash

### Godot version

3.4-3.5, 32bit editor

### System information

Windows 10, GLES3, NVidia GTX 970

### Issue description

I've been getting occasional random crashes in nvoglv32.dll.  I assume it's just some sort of driver bug, but since, for the first time, I got an actual call stack that might provide some hint, I figured I'd post it just in case it's a Godot bug.

Exception thrown at 0x7988CF5B (nvoglv32.dll) in godot.windows.opt.tools.32.exe: 0xC0000005: Access violation writing location 0x00000000.
```
 	nvoglv32.dll![Frames below may be incorrect and/or missing, no symbols loaded for nvoglv32.dll]	Unknown
 	[External Code]	
>	godot.windows.opt.tools.32.exe!RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer) Line 1167	C++
 	godot.windows.opt.tools.32.exe!VisualServerRaster::texture_get_data(RID arg1, int arg2) Line 147	C++
 	godot.windows.opt.tools.32.exe!VisualServerWrapMT::texture_get_data(RID p1, int p2) Line 85	C++
 	godot.windows.opt.tools.32.exe!ViewportTexture::get_data() Line 121	C++
 	godot.windows.opt.tools.32.exe!EditorNode::_save_scene_with_preview(String p_file, int p_idx) Line 1351	C++
 	godot.windows.opt.tools.32.exe!EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) Line 2368	C++
 	godot.windows.opt.tools.32.exe!EditorNode::_menu_option(int p_option) Line 1105	C++
 	godot.windows.opt.tools.32.exe!MethodBind1<EditorNode,int>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Variant::CallError & r_error) Line 867	C++
 	godot.windows.opt.tools.32.exe!Object::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 918	C++
 	godot.windows.opt.tools.32.exe!Object::emit_signal(const StringName & p_name, const Variant * * p_args, int p_argcount) Line 1224	C++
 	godot.windows.opt.tools.32.exe!Object::emit_signal(const StringName & p_name, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 1280	C++
 	godot.windows.opt.tools.32.exe!PopupMenu::activate_item(int p_item) Line 1147	C++
 	[External Code]	
```

```
	glActiveTexture(GL_TEXTURE0);

	glBindTexture(texture->target, texture->tex_id);

	glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);

	for (int i = 0; i < texture->mipmaps; i++) {
		int ofs = Image::get_image_mipmap_offset(texture->alloc_width, texture->alloc_height, real_format, i);

		if (texture->compressed) {
			glPixelStorei(GL_PACK_ALIGNMENT, 4);
			glGetCompressedTexImage(texture->target, i, &wb[ofs]);

		} else {
			glPixelStorei(GL_PACK_ALIGNMENT, 1);

			glGetTexImage(texture->target, i, texture->gl_format_cache, texture->gl_type_cache, &wb[ofs]);
		}
	}
```

Debugger had me on the line with the for loop.

### Steps to reproduce

I think it happens most often when editing shaders, but it seems to be somewhat random.

### Minimal reproduction project

Not specific to any project.  Happens a lot with the Material Maker project actually: https://github.com/RodZill4/material-maker