mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 10:25:46 +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:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user