diff options
author | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2018-01-24 19:24:18 +0100 |
---|---|---|
committer | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2018-01-24 19:24:18 +0100 |
commit | eb1f9375ead3ee772681d7176a238691489fde1b (patch) | |
tree | 074f6f127e62dff93a9bf62609b7f5df785e740a /core/io | |
parent | fa569210f5ef316177724169a42d2b82f4ab03d9 (diff) |
Detects crash-related marshalling errors due to NAN values
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/marshalls.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 9e21287780..3e20cc8c9b 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1211,7 +1211,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += len; if (buf) buf += len; - encode_variant(d[E->get()], buf, len, p_object_as_id); + Variant *v = d.getptr(E->get()); + ERR_FAIL_COND_V(!v, ERR_BUG); + encode_variant(*v, buf, len, p_object_as_id); ERR_FAIL_COND_V(len % 4, ERR_BUG); r_len += len; if (buf) |