From 37db8d61845f1bf22d50939268aa8baa2663d06b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 14 Jun 2021 12:29:41 +0800 Subject: Fix crash when freeing GradientTexture and NoiseTexture --- modules/opensimplex/noise_texture.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp index 9e0155da94..66c52ffbf9 100644 --- a/modules/opensimplex/noise_texture.cpp +++ b/modules/opensimplex/noise_texture.cpp @@ -187,6 +187,7 @@ Ref NoiseTexture::get_noise() { } void NoiseTexture::set_width(int p_width) { + ERR_FAIL_COND(p_width <= 0); if (p_width == size.x) { return; } @@ -195,6 +196,7 @@ void NoiseTexture::set_width(int p_width) { } void NoiseTexture::set_height(int p_height) { + ERR_FAIL_COND(p_height <= 0); if (p_height == size.y) { return; } -- cgit v1.2.3