summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholgac <huseyinolgac@gmail.com>2022-06-17 02:27:08 +0200
committerholgac <huseyinolgac@gmail.com>2022-06-17 02:27:08 +0200
commita5c01dc25acbbda6575f31e5904c1ff71197e322 (patch)
tree760e56be927f9050fc08b5c1349fd7af45cd1e1f
parent2a92176e4c39b423e5ee47c43794639d312bba63 (diff)
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.
-rw-r--r--scene/3d/lightmap_gi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp
index 9d1d8721e6..a602e7d6ad 100644
--- a/scene/3d/lightmap_gi.cpp
+++ b/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;
}