From a5c01dc25acbbda6575f31e5904c1ff71197e322 Mon Sep 17 00:00:00 2001 From: holgac Date: Fri, 17 Jun 2022 02:27:08 +0200 Subject: [PATCH] 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. --- scene/3d/lightmap_gi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 9d1d8721e65..a602e7d6ade 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; }