From 9d7d24682d5efd9cafb1e0fa52764bc44cf17b6b Mon Sep 17 00:00:00 2001 From: honix Date: Mon, 15 May 2017 20:49:20 +0300 Subject: [PATCH] Particles potential crash fix --- drivers/gles3/rasterizer_storage_gles3.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 1025acceb43..eed2afe71fb 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -4859,6 +4859,7 @@ void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount) Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND(!particles); + ERR_FAIL_COND(p_amount < 1); particles->amount = p_amount; @@ -4912,6 +4913,7 @@ void RasterizerStorageGLES3::particles_set_lifetime(RID p_particles, float p_lif Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND(!particles); + ERR_FAIL_COND(p_lifetime <= 0); particles->lifetime = p_lifetime; } void RasterizerStorageGLES3::particles_set_pre_process_time(RID p_particles, float p_time) {