Skip to content

Commit

Permalink
only parse userdata if type is equal to known user data type
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Aug 4, 2024
1 parent 563a657 commit 2fbf765
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions XvdTool.Streaming/StreamedXvdFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ private void ParseUserData()
using var userDataReader = new BinaryReader(new MemoryStream(userData));

_userDataHeader = userDataReader.ReadStruct<XvdUserDataHeader>();
_hasUserData = true;

userDataReader.BaseStream.Position = _userDataHeader.Length;

if (_userDataHeader.Type == XvdUserDataType.PackageFiles)
{
_hasUserData = true;

userDataReader.BaseStream.Position = _userDataHeader.Length;

_userDataPackageFilesHeader = userDataReader.ReadStruct<XvdUserDataPackageFilesHeader>();
Debug.Assert(int.MaxValue > _userDataPackageFilesHeader.FileCount, "int.MaxValue > _userDataPackageFilesHeader.FileCount");

Expand Down

0 comments on commit 2fbf765

Please sign in to comment.