RagingLightning / gvas-converter

Unreal Engine 4 save game converter - Adopted for TSW2 Livery files
MIT License
5 stars 3 forks source link

Error when reading string property in object #3

Closed agc93 closed 3 years ago

agc93 commented 3 years ago

I tried this out for parsing a save game, but had an exception when reading a string property inside an array. Since the call to UESerializer.Deserialize(null, ItemType, -1, reader) directly specified -1 as the valueLength, that gets passed all the way through to the ReadUEString(this BinaryReader reader, long vl) extension method and the -1 values causes an exception on line 39 since it's out of range.

From testing around, I found that changing UEStringProperty's constructor to the other overload worked fine:

-            Value = reader.ReadUEString(valueLength);
+           Value = reader.ReadUEString();

However, I'm not sure if that will break other things.

RagingLightning commented 3 years ago

I never had a closer look at that code since it was part of the original project, but now that I look at it... why is it even there? The code is literally reading the value length itself...

Anyway, should be fixed now