mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
utils.h,WEBP_ALIGN: make bitmask unsigned
this fixes runtime warnings with clang -fsanitize=integer when using the WEBP_ALIGN_CST constant in WEBP_ALIGN: implicit conversion from type 'int' of value -32 (32-bit, signed) to type 'unsigned int' changed the value to 4294967264 (32-bit, unsigned) Bug: b/229626362 Change-Id: I524d80e620b9869de4e6d322b7de6ffa1ec8657f
This commit is contained in:
parent
748e92bbb9
commit
c151e95bdc
@ -64,7 +64,8 @@ WEBP_EXTERN void WebPSafeFree(void* const ptr);
|
|||||||
// Alignment
|
// Alignment
|
||||||
|
|
||||||
#define WEBP_ALIGN_CST 31
|
#define WEBP_ALIGN_CST 31
|
||||||
#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & ~WEBP_ALIGN_CST)
|
#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & \
|
||||||
|
~(uintptr_t)WEBP_ALIGN_CST)
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
// memcpy() is the safe way of moving potentially unaligned 32b memory.
|
// memcpy() is the safe way of moving potentially unaligned 32b memory.
|
||||||
|
Loading…
Reference in New Issue
Block a user