summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-04 07:46:16 +0100
committerGitHub <noreply@github.com>2021-03-04 07:46:16 +0100
commit8ff25ffb78a1f1ff37273dbd90e1b5e47fb5a4e4 (patch)
tree87e43251b7ebfa362b3569d0d0a833ab229825ff
parent44e73473c6af24bc83ed2ec40a1c0162624dd8fc (diff)
parentef1d58f034233a0d8b5d0b5dbf539e851ffc726c (diff)
Merge pull request #46620 from sps1112/fix-control.edit_set_state-crash
Add size check in Control::_edit_set_state() to fix crash
-rw-r--r--scene/gui/control.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index bff3024e38..c625d6a2f3 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -73,6 +73,10 @@ Dictionary Control::_edit_get_state() const {
}
void Control::_edit_set_state(const Dictionary &p_state) {
+ ERR_FAIL_COND((p_state.size() <= 0) ||
+ p_state["rotation"].is_null() || p_state["scale"].is_null() ||
+ p_state["pivot"].is_null() || p_state["anchors"].is_null() || p_state["offsets"].is_null());
+
Dictionary state = p_state;
set_rotation(state["rotation"]);