Assert the ref_count is valid in ref_cnt_fb().
This is similar to the assertion I added to decrease_ref_count() in
commit d230388e48433458a0e93d380c7b951854c9f9ff:
https://aomedia-review.googlesource.com/c/aom/+/72161
BUG=aomedia:2179
Change-Id: I697478086a672261292ce3a03c9973e1fdd56e5a
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 5442638..e38988d 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -603,8 +603,10 @@
static INLINE void ref_cnt_fb(RefCntBuffer *bufs, int *idx, int new_idx) {
const int ref_index = *idx;
- if (ref_index >= 0 && bufs[ref_index].ref_count > 0)
+ if (ref_index >= 0) {
+ assert(bufs[ref_index].ref_count > 0);
bufs[ref_index].ref_count--;
+ }
*idx = new_idx;