#endif
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
+#include "vp8/common/common.h"
#include "vp8/common/threading.h"
-
#include "vp8/common/loopfilter.h"
#include "vp8/common/extend.h"
#include "vpx_ports/vpx_timer.h"
/* Allocate memory for above_row buffers. */
CALLOC_ARRAY(pbi->mt_yabove_row, pc->mb_rows);
- for (i = 0; i < pc->mb_rows; ++i)
+ for (i = 0; i < pc->mb_rows; ++i) {
CHECK_MEM_ERROR(pbi->mt_yabove_row[i],
vpx_memalign(16, sizeof(unsigned char) *
(width + (VP8BORDERINPIXELS << 1))));
+ vp8_zero_array(pbi->mt_yabove_row[i], width + (VP8BORDERINPIXELS << 1));
+ }
CALLOC_ARRAY(pbi->mt_uabove_row, pc->mb_rows);
- for (i = 0; i < pc->mb_rows; ++i)
+ for (i = 0; i < pc->mb_rows; ++i) {
CHECK_MEM_ERROR(pbi->mt_uabove_row[i],
vpx_memalign(16, sizeof(unsigned char) *
(uv_width + VP8BORDERINPIXELS)));
+ vp8_zero_array(pbi->mt_uabove_row[i], uv_width + VP8BORDERINPIXELS);
+ }
CALLOC_ARRAY(pbi->mt_vabove_row, pc->mb_rows);
- for (i = 0; i < pc->mb_rows; ++i)
+ for (i = 0; i < pc->mb_rows; ++i) {
CHECK_MEM_ERROR(pbi->mt_vabove_row[i],
vpx_memalign(16, sizeof(unsigned char) *
(uv_width + VP8BORDERINPIXELS)));
+ vp8_zero_array(pbi->mt_vabove_row[i], uv_width + VP8BORDERINPIXELS);
+ }
/* Allocate memory for left_col buffers. */
CALLOC_ARRAY(pbi->mt_yleft_col, pc->mb_rows);
if (!ybf->buffer_alloc) {
ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, frame_size);
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+ // This memset is needed for fixing the issue of using uninitialized
+ // value in msan test. It will cause a perf loss, so only do this for
+ // msan test.
+ memset(ybf->buffer_alloc, 0, frame_size);
+#endif
+#endif
ybf->buffer_alloc_sz = frame_size;
}