Browse Source

Added debugging check on line 1604

I added the code assert(f->valid_bits >= n);  instead of removing if (f->valid_bits < 0) return 0; to improve code with checking and debugging instead.
wph612 5 years ago
parent
commit
2e78eb603b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      stb_vorbis.c

+ 2 - 0
stb_vorbis.c

@@ -1601,6 +1601,8 @@ static uint32 get_bits(vorb *f, int n)
       }
       }
    }
    }
 
 
+   assert(f->valid_bits >= n);
+   
    z = f->acc & ((1 << n)-1);
    z = f->acc & ((1 << n)-1);
    f->acc >>= n;
    f->acc >>= n;
    f->valid_bits -= n;
    f->valid_bits -= n;