diff options
author | jackychen <jackychen@google.com> | 2015-10-30 11:08:23 -0700 |
---|---|---|
committer | jackychen <jackychen@google.com> | 2015-11-02 12:36:10 -0800 |
commit | fcb464671c099db58f10402d5e18bca86db23e35 (patch) | |
tree | 40896e1071b2b02eae89a267d95617f523b7b144 /vpx_scale/generic | |
parent | 082434b274d98671cb63b7337062700b79c08313 (diff) | |
download | libvpx-fcb464671c099db58f10402d5e18bca86db23e35.tar libvpx-fcb464671c099db58f10402d5e18bca86db23e35.tar.gz libvpx-fcb464671c099db58f10402d5e18bca86db23e35.tar.bz2 libvpx-fcb464671c099db58f10402d5e18bca86db23e35.zip |
vpx_scale: fix the issue in msan test.
Do memset to fix msan issue due to the access of uninitialized
memory.
BUG=https://code.google.com/p/chromium/issues/detail?id=549155
Change-Id: I02f995ede79e3574e72587cc078df1a0d11af002
Diffstat (limited to 'vpx_scale/generic')
-rw-r--r-- | vpx_scale/generic/yv12config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vpx_scale/generic/yv12config.c b/vpx_scale/generic/yv12config.c index 773921813..e1ee46eb7 100644 --- a/vpx_scale/generic/yv12config.c +++ b/vpx_scale/generic/yv12config.c @@ -203,6 +203,15 @@ int vpx_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, 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); |