From e9100a70515319789d0cbd9c6041d5003f60429a Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 27 Sep 2023 13:33:36 -0600 Subject: [PATCH] Remove `long` to `int` truncation of stream position --- .../Assets/Scripts/MessagePack/MessagePackSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs index ae5a50369..a75917b0b 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs @@ -440,7 +440,7 @@ private static T DeserializeFromSequenceAndRewindStreamIfPossible(Stream stre if (streamToRewind.CanSeek && !reader.End) { // Reverse the stream as many bytes as we left unread. - int bytesNotRead = checked((int)reader.Sequence.Slice(reader.Position).Length); + long bytesNotRead = reader.Sequence.Slice(reader.Position).Length; streamToRewind.Seek(-bytesNotRead, SeekOrigin.Current); }