]> granicus.if.org Git - libvpx/commitdiff
Fix ref count decrement code.
authorFrank Galligan <fgalligan@google.com>
Thu, 5 Dec 2013 06:21:00 +0000 (22:21 -0800)
committerFrank Galligan <fgalligan@google.com>
Thu, 5 Dec 2013 06:21:00 +0000 (22:21 -0800)
Buffer 0 would never be decremented, so it could only be used
once.

Change-Id: I605d99fa2a513eadae6a0e230161729880653282

vp9/common/vp9_onyxc_int.h

index 6d14128a8cf4fc1134dc9c8b4ea30635d2dd6a37..2c410669a7394ee21a506dd8df7fb4425d149ef4 100644 (file)
@@ -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;