diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-23 13:08:18 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-23 13:08:18 +0200 |
commit | ad1955a63d516037cc1f913db5ced05ef5b3b79e (patch) | |
tree | 6dd48b2b4cf0b0f05b70a210fbc2d8d466ff785a /drivers/gles3 | |
parent | 23a1104d783648593f89e972dca34c88e5269413 (diff) | |
parent | 574e61a542ea336902613d8c7b658e38b351ddae (diff) | |
download | redot-engine-ad1955a63d516037cc1f913db5ced05ef5b3b79e.tar.gz |
Merge pull request #94628 from Chaosus/rendering_fix_crash
Fix crash when assigning more textures than expected to texture array
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 1aaf840b30..41c23fc3ec 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -874,7 +874,8 @@ void MaterialData::update_textures(const HashMap<StringName, Variant> &p_paramet if (V->value.is_array()) { Array array = (Array)V->value; if (uniform_array_size > 0) { - for (int j = 0; j < array.size(); j++) { + int size = MIN(uniform_array_size, array.size()); + for (int j = 0; j < size; j++) { textures.push_back(array[j]); } } else { |