Browse Source

Avoid crash when texture layers is greater than 1 and format is not an ARRAY type

clayjohn 2 months ago
parent
commit
cc9aedd898
1 changed files with 1 additions and 1 deletions
  1. 1 1
      servers/rendering/rendering_device.cpp

+ 1 - 1
servers/rendering/rendering_device.cpp

@@ -1065,7 +1065,7 @@ RID RenderingDevice::texture_create(const TextureFormat &p_format, const Texture
 #endif
 
 	if (data.size()) {
-		for (uint32_t i = 0; i < p_format.array_layers; i++) {
+		for (uint32_t i = 0; i < format.array_layers; i++) {
 			_texture_initialize(id, i, data[i], immediate_flush);
 		}