Răsfoiți Sursa

Fix deserialization of int64 values

Ivan Savenko 10 luni în urmă
părinte
comite
ccb42deba4
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      lib/serializer/BinaryDeserializer.h

+ 2 - 2
lib/serializer/BinaryDeserializer.h

@@ -131,12 +131,12 @@ public:
 
 			if ((byteValue & 0x80) != 0)
 			{
-				valueUnsigned |= (byteValue & 0x7f) << offset;
+				valueUnsigned |= static_cast<uint64_t>(byteValue & 0x7f) << offset;
 				offset += 7;
 			}
 			else
 			{
-				valueUnsigned |= (byteValue & 0x3f) << offset;
+				valueUnsigned |= static_cast<uint64_t>(byteValue & 0x3f) << offset;
 				bool isNegative = (byteValue & 0x40) != 0;
 				if (isNegative)
 					return -static_cast<int64_t>(valueUnsigned);