You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Fix binary object marshalling, closes #9472
This commit is contained in:
@@ -807,11 +807,16 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
|
|||||||
encode_uint32(utf8.length(), buf);
|
encode_uint32(utf8.length(), buf);
|
||||||
buf += 4;
|
buf += 4;
|
||||||
copymem(buf, utf8.get_data(), utf8.length());
|
copymem(buf, utf8.get_data(), utf8.length());
|
||||||
|
buf += utf8.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
r_len += 4 + utf8.length();
|
r_len += 4 + utf8.length();
|
||||||
while (r_len % 4)
|
while (r_len % 4) {
|
||||||
r_len++; //pad
|
r_len++; //pad
|
||||||
|
if (buf) {
|
||||||
|
buf++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id) {
|
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user