Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@live.com>2022-08-12 16:28:20 +0300
committerGitHub <noreply@github.com>2022-08-12 16:28:20 +0300
commit94d86190bc8c30e98dae0220c0bce54cdfe48494 (patch)
treedfffd3f0856297c57da4a9dfabb3c53f9a92822b
parent10955cc19e09600aa935cf6eb99933bfabbc301b (diff)
parent0eccfe506044da8d1a1ca2ca3d4270d6c8e319d2 (diff)
Merge pull request #1481 from ValkaVales/patch-1
Fix OverflowException in SafeBitConverter.ToInt64
-rw-r--r--src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs
index 7eb77a00..8bbc141a 100644
--- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs
+++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs
@@ -13,15 +13,15 @@ namespace MessagePack
#if UNITY_ANDROID
if (BitConverter.IsLittleEndian)
{
- int i1 = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24);
- int i2 = value[4] | (value[5] << 8) | (value[6] << 16) | (value[7] << 24);
- return (uint)i1 | ((long)i2 << 32);
+ long i1 = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24);
+ long i2 = value[4] | (value[5] << 8) | (value[6] << 16) | (value[7] << 24);
+ return i1 | (i2 << 32);
}
else
{
- int i1 = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3];
- int i2 = (value[4] << 24) | (value[5] << 16) | (value[6] << 8) | value[7];
- return (uint)i2 | ((long)i1 << 32);
+ long i1 = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3];
+ long i2 = (value[4] << 24) | (value[5] << 16) | (value[6] << 8) | value[7];
+ return i2 | (i1 << 32);
}
#else
return MemoryMarshal.Cast<byte, long>(value)[0];