Skip to content

Commit

Permalink
fix: don't read only buffer values in uncooked CFXTrackItem
Browse files Browse the repository at this point in the history
  • Loading branch information
nikich340 committed Aug 25, 2024
1 parent d58fa6b commit f75f2e2
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions WolvenKit.CR2W/Types/BufferedTypes/Complex/CFXTrackItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,20 @@ public override void Read(BinaryReader file, uint size)
var startpos = file.BaseStream.Position;
base.Read(file, size);

// cooked only
if ((REDFlags & 8192) > 0)
{
var endpos = file.BaseStream.Position;
var endpos = file.BaseStream.Position;

var bytesread = endpos - startpos;
if (bytesread < size)
{
buffername.Read(file, 2);
count.Read(file, size);
unk.Read(file, 1);
var bytesread = endpos - startpos;
if (bytesread < size)
{
buffername.Read(file, 2);
count.Read(file, size);
unk.Read(file, 1);
if (IsCooked())
buffer.Read(file, 0, count.val);
}
else if (bytesread > size)
{
}
else if (bytesread > size)
{

}
}
//SetIsSerialized() in base
}
Expand Down

0 comments on commit f75f2e2

Please sign in to comment.