add WebPInt32ToMem

and use it in calls containing _mm_cvtsi32_si128; this calls
WebPUint32ToMem, but corrects the type to avoid runtime warnings with
clang -fsanitize=integer of the form:

implicit conversion from type 'int' of value -1904123502 (32-bit,
signed) to type 'uint32_t' (aka 'unsigned int') changed the value to
2390843794 (32-bit, unsigned)

Bug: b/229626362
Change-Id: I20545e822d8045fa44f688241879206055a0a148
This commit is contained in:
James Zern
2022-07-30 19:38:35 -07:00
parent 3fe15b6773
commit 748e92bbb9
4 changed files with 52 additions and 48 deletions

View File

@ -82,6 +82,10 @@ static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
memcpy(ptr, &val, sizeof(val));
}
static WEBP_INLINE void WebPInt32ToMem(uint8_t* const ptr, int val) {
WebPUint32ToMem(ptr, (uint32_t)val);
}
//------------------------------------------------------------------------------
// Reading/writing data.