From ccdd7ab890341f7345186648c5fb0e126ee1aadf Mon Sep 17 00:00:00 2001 From: Ignacio Abal <51810776+ignacioabal@users.noreply.github.com> Date: Wed, 17 Mar 2021 10:46:25 -0300 Subject: Added validation when assigning heightfield_resolution (Fix #46281) --- servers/rendering/renderer_rd/renderer_storage_rd.cpp | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3