seek to MetaDataOffset before reading FMetaData - #153
Open
yelvert wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
UAsset.Read()seeks to the recorded offset before every section except the metadata block,which parses from wherever the previous section left the cursor. That works only while the two
coincide.
They diverge when a package has gatherable text:
ReadLocMetadataObject()reads a single int32and returns when it's zero, under-reading the record, so the block ends 4 bytes short of
MetaDataOffset, measured 3841 against 3845, and 5273 against 5277, on two uncooked UE5.8blueprints.
FMetaDatathen starts early on unrelated bytes and usually throwsInvalid FString length: 1946157056. Where the wrong offset happens to decode, it misparsessilently instead.
This doesn't fix that under-read, only stops it corrupting an unrelated section, which every
other section already avoids by seeking.
Over 439 uncooked UE5.8 packages, with this as the only change: 21 that previously threw now
load, and the rest parse byte-identically.
Type of change
Testing
No test included, because nothing in
TestAssets/reproduces it,TestEditorAssets/*isUE4.27 where
MetaDataOffsetis 0, andTestEditorUE5_7/Blueprints/*has no gatherable text. Afixture needs an uncooked package with
MetaDataOffset > 0andGatherableTextDataCount > 0whose loc metadata objects are all empty. Saving a blueprint that carries an FText literal, a
Text variable with a default value, say, out of a UE5.8 editor project should produce one: the
text is what generates the gatherable-text block, while the graph nodes supply the object
metadata.