From 42a666ef0441ec94978490ea3b705f430f3452e5 Mon Sep 17 00:00:00 2001 From: Christian Luksch Date: Fri, 4 Nov 2022 18:08:35 +0100 Subject: [PATCH] [IO] added logging output in case there is a stream position mismatch --- src/Aardvark.Base.IO/BinaryReadingCoder.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Aardvark.Base.IO/BinaryReadingCoder.cs b/src/Aardvark.Base.IO/BinaryReadingCoder.cs index 2406d1a5..8e4d6962 100644 --- a/src/Aardvark.Base.IO/BinaryReadingCoder.cs +++ b/src/Aardvark.Base.IO/BinaryReadingCoder.cs @@ -244,7 +244,13 @@ 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 { @@ -252,7 +258,7 @@ public void Code(ref object obj) { 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; }