Pad 'Left' when building under ASan
The neon intrinsics are not able to load just the 4 values that are used. In vpx_dsp/arm/intrapred_neon.c:dc_4x4 it loads 8 values for both the 'above' and 'left' computations, but only uses the sum of the first 4 values. BUG=webm:1268 Change-Id: I937113d7e3a21e25bebde3593de0446bf6b0115a
This commit is contained in:
parent
85e111b3ba
commit
a7a8e07a44
@ -15,6 +15,8 @@
|
|||||||
#include "vp8_rtcd.h"
|
#include "vp8_rtcd.h"
|
||||||
#include "blockd.h"
|
#include "blockd.h"
|
||||||
#include "reconintra4x4.h"
|
#include "reconintra4x4.h"
|
||||||
|
#include "vp8/common/common.h"
|
||||||
|
#include "vpx_ports/mem.h"
|
||||||
|
|
||||||
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
|
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
|
||||||
const uint8_t *above, const uint8_t *left);
|
const uint8_t *above, const uint8_t *left);
|
||||||
@ -38,8 +40,19 @@ void vp8_intra4x4_predict(unsigned char *above, unsigned char *yleft,
|
|||||||
int left_stride, B_PREDICTION_MODE b_mode,
|
int left_stride, B_PREDICTION_MODE b_mode,
|
||||||
unsigned char *dst, int dst_stride,
|
unsigned char *dst, int dst_stride,
|
||||||
unsigned char top_left) {
|
unsigned char top_left) {
|
||||||
unsigned char Left[4];
|
|
||||||
unsigned char Aboveb[12], *Above = Aboveb + 4;
|
unsigned char Aboveb[12], *Above = Aboveb + 4;
|
||||||
|
#if HAVE_NEON
|
||||||
|
// Neon intrinsics are unable to load 32 bits, or 4 8 bit values. Instead, it
|
||||||
|
// over reads but does not use the extra 4 values.
|
||||||
|
unsigned char Left[8];
|
||||||
|
#if VPX_WITH_ASAN
|
||||||
|
// Silence an 'uninitialized read' warning. Although uninitialized values are
|
||||||
|
// indeed read, they are not used.
|
||||||
|
vp8_zero_array(Left, 8);
|
||||||
|
#endif // VPX_WITH_ASAN
|
||||||
|
#else
|
||||||
|
unsigned char Left[4];
|
||||||
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
Left[0] = yleft[0];
|
Left[0] = yleft[0];
|
||||||
Left[1] = yleft[left_stride];
|
Left[1] = yleft[left_stride];
|
||||||
|
@ -48,4 +48,14 @@
|
|||||||
#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
|
#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
|
#if !defined(__has_feature)
|
||||||
|
#define __has_feature(x) 0
|
||||||
|
#endif // !defined(__has_feature)
|
||||||
|
|
||||||
|
#if __has_feature(address_sanitizer) || __SANITIZE_ADDRESS__
|
||||||
|
#define VPX_WITH_ASAN 1
|
||||||
|
#else
|
||||||
|
#define VPX_WITH_ASAN 0
|
||||||
|
#endif // __has_feature(address_sanitizer) || __SANITIZE_ADDRESS
|
||||||
|
|
||||||
#endif // VPX_PORTS_MEM_H_
|
#endif // VPX_PORTS_MEM_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user