diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-24 09:40:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 09:40:42 +0200 |
commit | f1bcc641dd6c8ae9ac80da6f07e3b8d093c3ce68 (patch) | |
tree | 3b6b6c1e5bb43e4d094912094bf5b1b19e38aaa3 /modules/opensimplex/noise_texture.cpp | |
parent | 9ace46a7d292e768a108cb5ad2acf88dbc57e8a6 (diff) | |
parent | 37db8d61845f1bf22d50939268aa8baa2663d06b (diff) |
Merge pull request #49583 from timothyqiu/texture-crash
Fix crash when freeing GradientTexture and NoiseTexture
Diffstat (limited to 'modules/opensimplex/noise_texture.cpp')
-rw-r--r-- | modules/opensimplex/noise_texture.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<OpenSimplexNoise> 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; } |