From: Wan-Teh Chang Date: Mon, 8 Oct 2018 17:03:06 +0000 (-0700) Subject: Correct a for loop in init_ref_frame_bufs. X-Git-Tag: v1.8.0~258^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51a47b0c723aba3f75315d760afe767b08a37cb9;p=libvpx Correct a for loop in init_ref_frame_bufs. The cm->ref_frame_map and pool->frame_bufs arrays are of different sizes (REF_FRAMES and FRAME_BUFFERS, respectively), so init_ref_frame_bufs() cannot iterate over these two arrays using the same for loop. Change-Id: Ica5bbd9d0c30ea3d089ad2d4bcf6cd8ae2daea64 --- diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index c2ffe1ad1..9f092a0b6 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4910,6 +4910,8 @@ static void init_ref_frame_bufs(VP9_COMMON *cm) { cm->new_fb_idx = INVALID_IDX; for (i = 0; i < REF_FRAMES; ++i) { cm->ref_frame_map[i] = INVALID_IDX; + } + for (i = 0; i < FRAME_BUFFERS; ++i) { pool->frame_bufs[i].ref_count = 0; } }