summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-14 18:35:36 +0200
committerGitHub <noreply@github.com>2021-06-14 18:35:36 +0200
commit0610c559ec85f1ddd36a8ad2dc127e20ce2986b8 (patch)
tree6b0e4557419e6e594b1c9779bd430ee883c4e6f4 /servers
parent0c4e8025abaa701f2240ceee3e096a8965371b7a (diff)
parent1b122345c20aa6830d59500b77b13f8b0bd337a8 (diff)
Merge pull request #49585 from timothyqiu/oh-unsigned
Fix invalid read when using MultiMesh
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index eeca283c13..9b08da4c9e 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -3823,7 +3823,7 @@ void RendererStorageRD::_update_dirty_multimeshes() {
if (multimesh->data_cache_used_dirty_regions) {
uint32_t data_cache_dirty_region_count = (multimesh->instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1;
- uint32_t visible_region_count = (visible_instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1;
+ uint32_t visible_region_count = visible_instances == 0 ? 0 : (visible_instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1;
uint32_t region_size = multimesh->stride_cache * MULTIMESH_DIRTY_REGION_SIZE * sizeof(float);