mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-25 21:28:22 +01:00
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 04b029d236
)
This commit is contained in:
parent
0af22e17d6
commit
88692490a5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user