From 88692490a5fbdf3ee4978db8112798d4a94226e6 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 30 Oct 2017 17:08:46 -0700 Subject: [PATCH] WebPMemToUint32: remove ptr cast to int this can result in an alignment hint on arm causing a SIGBUS. casting the input ptr to anything aside from its type is unnecessary for memcpy and is contrary to the intent of this function. Change-Id: I9a4d3f4be90f80cd8c3e96ccbe557e51e34cf7a5 (cherry picked from commit 04b029d236ff00a29de757b23b8787efd4a5a8f2) --- src/utils/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.h b/src/utils/utils.h index 2220e594..849e5d84 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -66,7 +66,7 @@ WEBP_EXTERN(void) WebPSafeFree(void* const ptr); // memcpy() is the safe way of moving potentially unaligned 32b memory. static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) { uint32_t A; - memcpy(&A, (const int*)ptr, sizeof(A)); + memcpy(&A, ptr, sizeof(A)); return A; } static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {