mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-11 02:20:33 +02:00
add WebPMemToInt32
and use it with calls to _mm_cvtsi32_si128 and _mm_set_epi32; this calls WebPMemToUint32, but corrects the type to avoid runtime warnings with clang -fsanitize=integer of the form: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2155905152 (32-bit, unsigned) to type 'int' changed the value to -2139062144 (32-bit, signed) Bug: b/229626362 Change-Id: I50101ba2b46dfaa852f02d46830f3511c80b02d9
This commit is contained in:
@ -73,6 +73,11 @@ static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) {
|
||||
memcpy(&A, ptr, sizeof(A));
|
||||
return A;
|
||||
}
|
||||
|
||||
static WEBP_INLINE int32_t WebPMemToInt32(const uint8_t* const ptr) {
|
||||
return (int32_t)WebPMemToUint32(ptr);
|
||||
}
|
||||
|
||||
static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
|
||||
memcpy(ptr, &val, sizeof(val));
|
||||
}
|
||||
|
Reference in New Issue
Block a user