Save binary ProjectSettings key length properly

(cherry picked from commit 06c0a5f9f2)
This commit is contained in:
Haoyu Qiu 2021-06-16 16:32:03 +08:00 committed by Rémi Verschelde
parent f36a3c67e3
commit c1b2bd6fb6
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 4 deletions

View File

@ -690,8 +690,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
file->store_32(count + 1); file->store_32(count + 1);
//store how many properties are saved, add one for custom featuers, which must always go first //store how many properties are saved, add one for custom featuers, which must always go first
String key = CoreStringNames::get_singleton()->_custom_features; String key = CoreStringNames::get_singleton()->_custom_features;
file->store_32(key.length()); file->store_pascal_string(key);
file->store_string(key);
int len; int len;
err = encode_variant(p_custom_features, NULL, len, false); err = encode_variant(p_custom_features, NULL, len, false);
@ -728,8 +727,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
else else
value = get(key); value = get(key);
file->store_32(key.length()); file->store_pascal_string(key);
file->store_string(key);
int len; int len;
err = encode_variant(value, NULL, len, true); err = encode_variant(value, NULL, len, true);