diff options
author | Ronald S. Bultje <rbultje@google.com> | 2013-01-25 16:03:15 -0800 |
---|---|---|
committer | Ronald S. Bultje <rbultje@google.com> | 2013-01-25 17:18:08 -0800 |
commit | 9dc9f07fb8a1452fb123d280741bfbc6469a6ec1 (patch) | |
tree | 4a8b24d3ac4d8c2eb90658ff1491bcc4a68b6fa2 /vp9/common/vp9_alloccommon.c | |
parent | 0a7b3953f0d4a80d7053e330c5352e80ca0f5710 (diff) | |
download | libvpx-9dc9f07fb8a1452fb123d280741bfbc6469a6ec1.tar libvpx-9dc9f07fb8a1452fb123d280741bfbc6469a6ec1.tar.gz libvpx-9dc9f07fb8a1452fb123d280741bfbc6469a6ec1.tar.bz2 libvpx-9dc9f07fb8a1452fb123d280741bfbc6469a6ec1.zip |
Fix overread/write reported by valgrind if (mb_cols) & 3 != 0.
We'd backup and restore all cols for a 64x64 SB, but the array wouldn't
be big enough to hold all that data.
Change-Id: Ic68ea721bf07e0b2f3937bd16b0b734bcc743ce1
Diffstat (limited to 'vp9/common/vp9_alloccommon.c')
-rw-r--r-- | vp9/common/vp9_alloccommon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index f2107d7aa..c4eb9fb7c 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -134,7 +134,8 @@ int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) { oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1; - oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1); + oci->above_context = + vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * (3 + oci->mb_cols), 1); if (!oci->above_context) { vp9_de_alloc_frame_buffers(oci); |