Skip to content

Commit

Permalink
[IO] added logging output in case there is a stream position mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
luithefirst committed Nov 4, 2022
1 parent 174f436 commit 42a666e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Aardvark.Base.IO/BinaryReadingCoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,21 @@ public void Code(ref object obj)
if (tmobj != null) CodeFields(typeInfo.Type, tmobj);
}
if ((typeInfo.Options & TypeInfo.Option.Size) != 0)
m_reader.BaseStream.Position = end;
{
if (m_reader.BaseStream.Position != end)
{
Report.Warn("invalid stream position after reading type \"{0}\" (potentially skipping referenced objects)", typeName);
m_reader.BaseStream.Position = end;
}
}
}
else
{
if ((typeInfo.Options & TypeInfo.Option.Size) != 0)
{
m_reader.BaseStream.Position = end;
Report.Warn(
"skipping object of uncodeable type \"{0}\"",
"skipping object of uncodeable type \"{0}\" (potentially skipping referenced objects)",
typeName);
obj = null;
}
Expand Down

0 comments on commit 42a666e

Please sign in to comment.