mirror of
https://github.com/webmproject/libwebp.git
synced 2025-09-02 17:22:28 +02:00
Apply "default unsafe" annotation across webputils
Import bounds_safety.h across all of webputils, with one exception being dsp.h, since it's imported by webputils.h in one place. Also prepend WEBP_ASSUME_UNSAFE_INDEXABLE_ABI to every webputil file to indicate to the compiler that every pointer should be treated as __unsafe_indexable. We also need to replace memcpy/memset/memmove with the unsafe variants WEBP_UNSAFE_*, as memcpy/memset/memmove require bounded/sized pointers. With this change, all of libwebputils (and libwebp) should build with -DWEBP_ENABLE_FBOUNDS_SAFETY=true Change-Id: Iad87be0455182d534c074ef6dc1a30fa66b74b6c
This commit is contained in:
@@ -26,10 +26,13 @@
|
||||
#include "src/dsp/cpu.h"
|
||||
#include "src/dsp/dsp.h"
|
||||
#include "src/utils/bit_reader_utils.h"
|
||||
#include "src/utils/bounds_safety.h"
|
||||
#include "src/utils/endian_inl_utils.h"
|
||||
#include "src/utils/utils.h"
|
||||
#include "src/webp/types.h"
|
||||
|
||||
WEBP_ASSUME_UNSAFE_INDEXABLE_ABI
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -79,7 +82,7 @@ static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE void VP8LoadNewBytes(
|
||||
: "memory", "at");
|
||||
#else
|
||||
lbit_t in_bits;
|
||||
memcpy(&in_bits, br->buf, sizeof(in_bits));
|
||||
WEBP_UNSAFE_MEMCPY(&in_bits, br->buf, sizeof(in_bits));
|
||||
#endif
|
||||
br->buf += BITS >> 3;
|
||||
#if !defined(WORDS_BIGENDIAN)
|
||||
|
Reference in New Issue
Block a user