shithub: libvpx

Download patch

ref: 51a47b0c723aba3f75315d760afe767b08a37cb9
parent: ecc31d28781c490f5fb18a3e6873692a1b8e6cea
author: Wan-Teh Chang <wtc@google.com>
date: Mon Oct 8 06:03:06 EDT 2018

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

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -4910,6 +4910,8 @@
   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;
   }
 }