ref: b5af9d2905b672b1c14f781a03abdaaa479cb8ea
parent: ed364b2114f871ffeed4736c3e322bfd96646476
parent: 66c6f7bf61fd0e5915cccb832dea62ce7fe4262e
author: hkuang <hkuang@google.com>
date: Fri Jan 10 05:59:00 EST 2014
Merge "Fix Issue #679: vp9 C loop filter produces valgrind warning."
--- a/vpx_scale/generic/yv12config.c
+++ b/vpx_scale/generic/yv12config.c
@@ -175,6 +175,11 @@
return -1;
}
+ // This memset is needed for fixing valgrind error from C loop filter
+ // due to access uninitialized memory in frame border. It could be
+ // removed if border is totally removed.
+ vpx_memset(ext_fb->data, 0, ext_fb->size);
+
ybf->buffer_alloc = yv12_align_addr(ext_fb->data, 32);
}
} else {
@@ -183,15 +188,20 @@
if (ybf->buffer_alloc)
vpx_free(ybf->buffer_alloc);
ybf->buffer_alloc = vpx_memalign(32, frame_size);
+ if (!ybf->buffer_alloc)
+ return -1;
+
ybf->buffer_alloc_sz = frame_size;
+
+ // This memset is needed for fixing valgrind error from C loop filter
+ // due to access uninitialized memory in frame boarder. It could be
+ // removed if border is totally removed.
+ vpx_memset(ybf->buffer_alloc, 0, ybf->buffer_alloc_sz);
}
if (ybf->buffer_alloc_sz < frame_size)
return -1;
}
-
- if (!ybf->buffer_alloc)
- return -1;
/* Only support allocating buffers that have a border that's a multiple
* of 32. The border restriction is required to get 16-byte alignment of
--
⑨