shithub: libvpx

Download patch

ref: d73e6cef758da47d582b0485e736acc2417a6f70
parent: 61f240c288c627ac0f7027e87bc7fb644071ea22
parent: fcb464671c099db58f10402d5e18bca86db23e35
author: Jacky Chen <[email protected]>
date: Mon Nov 2 18:37:23 EST 2015

Merge "vpx_scale: fix the issue in msan test."

--- a/vpx_scale/generic/yv12config.c
+++ b/vpx_scale/generic/yv12config.c
@@ -203,6 +203,15 @@
         return -1;
 
       ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+
+#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, (int)frame_size);
+#endif
+#endif
     } else if (frame_size > (size_t)ybf->buffer_alloc_sz) {
       // Allocation to hold larger frame, or first allocation.
       vpx_free(ybf->buffer_alloc);