소스 검색

Fix deserialization of int64 values

Ivan Savenko 10 달 전
부모
커밋
ccb42deba4
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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);