metadata: Fix sign extension in get_uint64_le() routine

Change-Id: Ibd85cf72ac1babd1fa636c341b90b76bdfc0491b
This commit is contained in:
Solomon Peachy 2021-08-05 09:41:39 -04:00
parent 566d836ac6
commit 9f0f2c6658

View file

@ -149,7 +149,7 @@ uint64_t get_uint64_le(void* buf)
{
unsigned char* p = (unsigned char*) buf;
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24) | ((uint64_t)p[4] << 32) |
return ((uint64_t)p[0]) | ((uint64_t)p[1] << 8) | ((uint64_t)p[2] << 16) | ((uint64_t)p[3] << 24) | ((uint64_t)p[4] << 32) |
((uint64_t)p[5] << 40) | ((uint64_t)p[6] << 48) | ((uint64_t)p[7] << 56);
}