summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-08-05 09:41:39 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-08-05 13:44:39 +0000
commit9f0f2c66586e8958aa852bc3e67053a875f67031 (patch)
treee5b291c4818ae50c41e78a84343e8184d1fbed90
parent566d836ac6170e6b5aff60f8becf4f825b454918 (diff)
metadata: Fix sign extension in get_uint64_le() routine
Change-Id: Ibd85cf72ac1babd1fa636c341b90b76bdfc0491b
-rw-r--r--lib/rbcodec/metadata/metadata_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rbcodec/metadata/metadata_common.c b/lib/rbcodec/metadata/metadata_common.c
index b062c5282d..0967570a5d 100644
--- a/lib/rbcodec/metadata/metadata_common.c
+++ b/lib/rbcodec/metadata/metadata_common.c
@@ -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);
}