summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-03 17:00:38 +0100
committerGitHub <noreply@github.com>2021-03-03 17:00:38 +0100
commitf3e98c286ae1b4b401e5e22c6b07bc61d0c5ea48 (patch)
tree5ebb9007e84145cf1577fcb43371400579a05ea4 /scene/3d
parentd0e62518a8035553429a759826c59aa7975460ef (diff)
parent18bb6e74be78342cfed9a141dcaba8dbd311f8f3 (diff)
Merge pull request #46616 from sps1112/fix-bakedlightmap-crash
Add size check in BakedLightmapData::_set_user_data()
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/baked_lightmap.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 578ea823f0..402e2b8f40 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -78,6 +78,7 @@ void BakedLightmapData::clear_users() {
}
void BakedLightmapData::_set_user_data(const Array &p_data) {
+ ERR_FAIL_COND(p_data.size() <= 0);
ERR_FAIL_COND((p_data.size() % 4) != 0);
for (int i = 0; i < p_data.size(); i += 4) {