mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
utils.h: quiet -fsanitize=undefined warnings
add WEBP_UBSAN_IGNORE_UNDEF to WebPMemToUint32() / WebPUint32ToMem() when WEBP_FORCE_ALIGNED is unset Change-Id: I726b2e708ce29681584eb10c8874d5cf1e798756
This commit is contained in:
parent
ea0be354a0
commit
af81fdb772
@ -21,6 +21,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "../dsp/dsp.h"
|
||||
#include "../webp/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -65,10 +66,12 @@ static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
|
||||
memcpy(ptr, &val, sizeof(val));
|
||||
}
|
||||
#else
|
||||
static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) {
|
||||
static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE
|
||||
uint32_t WebPMemToUint32(const uint8_t* const ptr) {
|
||||
return *(const uint32_t*)ptr;
|
||||
}
|
||||
static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
|
||||
static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE
|
||||
void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
|
||||
*(uint32_t*)ptr = val;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user