From: Ronald S. Bultje Date: Sat, 26 Jan 2013 00:03:15 +0000 (-0800) Subject: Fix overread/write reported by valgrind if (mb_cols) & 3 != 0. X-Git-Tag: v1.3.0~1151^2~227^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dc9f07fb8a1452fb123d280741bfbc6469a6ec1;p=libvpx 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 --- 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);