]> granicus.if.org Git - libvpx/commitdiff
Correct a for loop in init_ref_frame_bufs.
authorWan-Teh Chang <wtc@google.com>
Mon, 8 Oct 2018 17:03:06 +0000 (10:03 -0700)
committerWan-Teh Chang <wtc@google.com>
Mon, 8 Oct 2018 17:09:26 +0000 (10:09 -0700)
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

vp9/encoder/vp9_encoder.c

index c2ffe1ad17fe8dc4ab63261b404f1d86f24a8f63..9f092a0b60a7f28c6e56a0faf0bf35bfd08f29c0 100644 (file)
@@ -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;
   }
 }