summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-17 16:39:52 +0100
committerGitHub <noreply@github.com>2021-03-17 16:39:52 +0100
commitdb08e64a02800c061f1309cdb8629f1ce5b8ec92 (patch)
treef8fa4a1b6aa2738c607bc16a1360ce74f3ff9d26
parent0615e55b27b0ba178715154d591a79d88322eebf (diff)
parentccdd7ab890341f7345186648c5fb0e126ee1aadf (diff)
Merge pull request #47097 from ignacioabal/master
Added validation when assigning heightfield_resolution (Fix #46281)
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index 2a34049675..ba5ace8f31 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -5121,6 +5121,7 @@ void RendererStorageRD::particles_collision_height_field_update(RID p_particles_
void RendererStorageRD::particles_collision_set_height_field_resolution(RID p_particles_collision, RS::ParticlesCollisionHeightfieldResolution p_resolution) {
ParticlesCollision *particles_collision = particles_collision_owner.getornull(p_particles_collision);
ERR_FAIL_COND(!particles_collision);
+ ERR_FAIL_INDEX(p_resolution, RS::PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX);
if (particles_collision->heightfield_resolution == p_resolution) {
return;