From: Frank Galligan Date: Thu, 5 Dec 2013 06:21:00 +0000 (-0800) Subject: Fix ref count decrement code. X-Git-Tag: v1.4.0~2900 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ecf3bc91c1773902bd645655213d1c592251707;p=libvpx Fix ref count decrement code. Buffer 0 would never be decremented, so it could only be used once. Change-Id: I605d99fa2a513eadae6a0e230161729880653282 --- diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 6d14128a8..2c410669a 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -240,7 +240,7 @@ static int get_free_fb(VP9_COMMON *cm) { static void ref_cnt_fb(int *buf, int *idx, int new_idx) { const int ref_index = *idx; - if (ref_index > 0 && buf[ref_index] > 0) + if (ref_index >= 0 && buf[ref_index] > 0) buf[ref_index]--; *idx = new_idx;