summaryrefslogtreecommitdiffstats
path: root/scene/resources/texture.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-06-24 09:40:42 +0200
committerGitHub <noreply@github.com>2021-06-24 09:40:42 +0200
commitf1bcc641dd6c8ae9ac80da6f07e3b8d093c3ce68 (patch)
tree3b6b6c1e5bb43e4d094912094bf5b1b19e38aaa3 /scene/resources/texture.cpp
parent9ace46a7d292e768a108cb5ad2acf88dbc57e8a6 (diff)
parent37db8d61845f1bf22d50939268aa8baa2663d06b (diff)
downloadredot-engine-f1bcc641dd6c8ae9ac80da6f07e3b8d093c3ce68.tar.gz
Merge pull request #49583 from timothyqiu/texture-crash
Fix crash when freeing GradientTexture and NoiseTexture
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r--scene/resources/texture.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index b8dd8b1c14..acc85cf7df 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -1595,6 +1595,7 @@ void GradientTexture::_update() {
}
void GradientTexture::set_width(int p_width) {
+ ERR_FAIL_COND(p_width <= 0);
width = p_width;
_queue_update();
}