From 2e78eb603b1be816deb4a9701452bfe9905714c2 Mon Sep 17 00:00:00 2001 From: wph612 <43688928+vickit144@users.noreply.github.com> Date: Tue, 24 Mar 2020 20:49:40 -0400 Subject: [PATCH] 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. --- stb_vorbis.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stb_vorbis.c b/stb_vorbis.c index 4e67726..2662d15 100644 --- a/stb_vorbis.c +++ b/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); f->acc >>= n; f->valid_bits -= n;