Browse Source

Fixes #62096: LightmapGIData::_get_light_textures_data crash on empty image

The program crashes when trying to determine slice width/height if the
light texture is empty. This fix just returns an empty array, as if the
light texture does not exist.
holgac 3 năm trước cách đây
mục cha
commit
a5c01dc25a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      scene/3d/lightmap_gi.cpp

+ 1 - 1
scene/3d/lightmap_gi.cpp

@@ -116,7 +116,7 @@ void LightmapGIData::_set_light_textures_data(const Array &p_data) {
 
 Array LightmapGIData::_get_light_textures_data() const {
 	Array ret;
-	if (light_texture.is_null()) {
+	if (light_texture.is_null() || light_texture->get_layers() == 0) {
 		return ret;
 	}